buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
H,W=map(int,input().split()) import math A=[0,math.ceil(W/2)] if (H-1)*(W-1)!=0: c=W*math.floor(H/2)+A[H%2] else: c=0 print(c)
H,W=map(int,input().split()) import math A=[0,math.ceil(W/2)] if (H-1)*(W-1)!=0: c=W*math.floor(H/2)+A[H%2] else: c=1 print(c)
[["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]]
5
75
H,W = map(int, input().split()) if H == 1: print(1) elif W == 1: print(1) else: ans = H*(W // 2) if H % 2 == 1: if W % 2 == 0: ans += W // 2 else: ans += W // 2 + 1 print(ans)
H, W = map(int, input().split()) if W == 1: print(1) elif H == 1: print(1) else: ans = W * (H // 2) if H % 2 == 1: if W % 2 == 0: ans += W // 2 else: ans += W // 2 + 1 print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 31...
5
77
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; // vector<vector<int>> a(h, vector<int>(w)); int sum = h * w; if (h == 1 || w == 1) { cout << 1 << endl; } else { if (sum % 2 == 1) { cout << sum / 2 + 1 << endl; } else { cout << sum / 2 << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { long long int h, w; cin >> h >> w; // vector<vector<int>> a(h, vector<int>(w)); long long int sum = h * w; if (h == 1 || w == 1) { cout << 1 << endl; } else { if (sum % 2 == 1) { cout << sum / 2 + 1 << endl; } else { cout <...
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
83
h,w=map(int,input().split()) if h==1 and w==1: print(1) exit() ans=h*(w//2) if w%2==1: ans+=(h+2-1)//2 print(ans)
h,w=map(int,input().split()) if h==1 or w==1: print(1) exit() ans=h*(w//2) if w%2==1: ans+=(h+2-1)//2 print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354]]
5
63
h,w = map(int, input().split()) a = h*w if h==1 or w==1: print(0) elif a%2==0: print(a//2) else: print(a//2+1)
h,w = map(int, input().split()) a = h*w if h==1 or w==1: print(1) elif a%2==0: print(a//2) else: print(a//2+1)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
57
h,w=[int(x) for x in input().split()] if h==1 or w==1: print(0) elif (h*w)%2==0: print((h*w)//2) else: print((h*w)//2+1)
h,w=[int(x) for x in input().split()] if h==1 or w==1: print(1) elif (h*w)%2==0: print((h*w)//2) else: print((h*w)//2+1)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
68
a,b=map(int,input().split()) if min(a,b)==0: ans=1 else: c=(a*b)%2 if c==0: ans=(a*b)//2 elif c==1: ans=((a*b)//2)+1 print(ans)
a,b=map(int,input().split()) if min(a,b)==1: ans=1 else: c=(a*b)%2 if c==0: ans=(a*b)//2 elif c==1: ans=((a*b)//2)+1 print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
76
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long h = sc.nextLong(); long w = sc.nextLong(); long s = h * w; if (s % 2 == 1) { s += 1; } if (h == 1 || w == 1) s = 1; System.out.println(s); } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long h = sc.nextLong(); long w = sc.nextLong(); long s = h * w; if (s % 2 == 1) { s += 1; } s /= 2; if (h == 1 || w == 1) s = 1; System.out.println(s)...
[["+", 0, 195, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 17, 90], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 12, 499], ["+", 8, 498, 0, 195, 8, 196, 0, 1, 0, 35]]
3
97
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <climits> //long long型の最大値(LLONG_MAX)など #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小...
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <climits> //long long型の最大値(LLONG_MAX)など #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小...
[["+", 0, 1, 0, 16, 31, 16, 12, 74, 0, 24], ["+", 0, 16, 31, 16, 12, 74, 39, 77, 39, 78], ["+", 0, 1, 0, 16, 31, 16, 12, 74, 0, 25]]
1
130
h,w = list(map(int, input().split())) if h==1 or w==1: print(0) else: q,r = divmod(h*w, 2) print(q+r)
h,w = list(map(int, input().split())) if h==1 or w==1: print(1) else: q,r = divmod(h*w, 2) print(q+r)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
52
def resolve(): H, W = list(map(int, input().split())) ans = 0 if (H == 1 and W == 1): print(1) return if H % 2 == 1: even = (H // 2) + 1 else: even = (H // 2) odd = H - even if W % 2 == 1: ans += even * (W // 2 + 1) else: ans += even * (W...
def resolve(): H, W = list(map(int, input().split())) ans = 0 if (H == 1 or W == 1): print(1) return if H % 2 == 1: even = (H // 2) + 1 else: even = (H // 2) odd = H - even if W % 2 == 1: ans += even * (W // 2 + 1) else: ans += even * (W ...
[["-", 8, 196, 0, 57, 15, 23, 0, 679, 17, 355], ["+", 8, 196, 0, 57, 15, 23, 0, 679, 17, 354]]
5
119
h,w = map(int, input().split()) if(h==1 or w==2): print('1') elif(h%2 == 0 or w%2 == 0): print((h*w)//2) else: print((h*w+1)//2)
h,w = map(int, input().split()) if(h==1 or w==1): print('1') elif(h%2 == 0 or w%2 == 0): print((h*w)//2) else: print((h*w+1)//2)
[["-", 0, 57, 15, 23, 0, 679, 12, 666, 0, 612], ["+", 0, 57, 15, 23, 0, 679, 12, 666, 0, 612]]
5
72
(a,b)=[int(x) for x in input().split()] if a==0 or b==0: print(1) else: print((a*b+1)//2)
(a,b)=[int(x) for x in input().split()] if a==1 or b==1: print(1) else: print((a*b+1)//2)
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
49
H, W = [int(x) for x in input().split(" ")] if H > W: H, W = W, H if H == 1: print(1) if H % 2 == 0: print(W * (H // 2)) else: if W % 2 == 0: print(W * H // 2) else: print(((W - 1) * H // 2) + H // 2 + 1)
H, W = [int(x) for x in input().split(" ")] if H > W: H, W = W, H if H == 1: print(1) elif H % 2 == 0: print(W * (H // 2)) else: if W % 2 == 0: print(W * H // 2) else: print(((W - 1) * H // 2) + H // 2 + 1)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
100
hw = gets.split(' ').map(&:to_i) h = hw[0] w = hw[1] h_move = (w/2.0).ceil h_move2 = ((w-1)/2.0).ceil if h == 1 then print "1" elsif h % 2 == 0 then total = (h_move+h_move2) * (h/2.0).floor print total.to_s else total = (h_move+h_move2) * (h/2.0).floor total += h_move print total.to_s end
hw = gets.split(' ').map(&:to_i) h = hw[0] w = hw[1] h_move = (w/2.0).ceil h_move2 = ((w-1)/2.0).ceil if h == 1 || w == 1 then print "1" elsif h % 2 == 0 then total = (h_move+h_move2) * (h/2.0).floor print total.to_s else total = (h_move+h_move2) * (h/2.0).floor total += h_move print total.t...
[["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 106], ["+", 0, 493, 0, 121, 15, 738, 12, 738, 31, 22], ["+", 0, 493, 0, 121, 15, 738, 12, 738, 17, 60], ["+", 0, 493, 0, 121, 15, 738, 12, 738, 12, 612]]
4
109
from sys import stdin h, w = [int(x) for x in stdin.readline().strip().split()] if(h == 1 or w == 1): print(0) else: print((h//2)*(w//2)+((h+1)//2)*((w+1)//2))
from sys import stdin h, w = [int(x) for x in stdin.readline().strip().split()] if(h == 1 or w == 1): print(1) else: print((h//2)*(w//2)+((h+1)//2)*((w+1)//2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
81
x, y = map(int, input().split()) if x == 1 or y == 1: print(0) elif (x * y) % 2 == 0: print((x * y) // 2) else: print((x * y + 1) // 2)
x, y = map(int, input().split()) if x == 1 or y == 1: print(1) elif (x * y) % 2 == 0: print((x * y) // 2) else: print((x * y + 1) // 2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
64
import math from collections import deque from collections import defaultdict def readInt(): return int(input()) def readInts(): return list(map(int, input().split())) def readChar(): return input() def readChars(): return input().split() def factorization(n): res = [] if n%2==0: res.append(2) for i in range(...
import math from collections import deque from collections import defaultdict def readInt(): return int(input()) def readInts(): return list(map(int, input().split())) def readChar(): return input() def readChars(): return input().split() def factorization(n): res = [] if n%2==0: res.append(2) for i in range(...
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
972
h,w=map(int,input().split()) if h==1 or w==1: print(0) else: if (h*w)%2==0: print(h*w//2) else: print((h*w+1)//2)
h,w=map(int,input().split()) if h==1 or w==1: print(1) else: if (h*w)%2==0: print(h*w//2) else: print((h*w+1)//2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
64
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) else: print(((h*W) + 1) // 2)
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) else: print(((H*W) + 1) // 2)
[["-", 31, 23, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 31, 23, 0, 657, 31, 23, 0, 657, 31, 22]]
5
45
def main(): #from sys import stdin, setrecursionlimit #setrecursionlimit(10**9) #r = input() #n = int(input()) #a, b = map(int, input().split()) #s, y = input().split() #a = input().split() #a = list(map(int, input().split())) #a = [input().split() for i in range(n)] #a = [int(in...
def main(): #from sys import stdin, setrecursionlimit #setrecursionlimit(10**9) #r = input() #n = int(input()) #a, b = map(int, input().split()) #s, y = input().split() #a = input().split() #a = list(map(int, input().split())) #a = [input().split() for i in range(n)] #a = [int(in...
[["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 8, 196, 0, 57, 64, 196, 0, 37, 0, 612]]
5
83
#include <bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; if (h == 1 || w == 1) { cout << 1 << endl; } else if ((h * w) % 2 == 0) { cout << (h * w) / 2 << endl; } else { cout << (h * w + 1) / 2 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int64_t h, w; cin >> h >> w; if (h == 1 || w == 1) { cout << 1 << endl; } else if ((h * w) % 2 == 0) { cout << (h * w) / 2 << endl; } else { cout << (h * w + 1) / 2 << endl; } }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
85
h,w=map(int,input().split()) if h==1 and w==1: print(1) elif h*w%2==0: print(h*w//2) else: print(h*w//2+1)
h,w=map(int,input().split()) if h==1 or w==1: print(1) elif h*w%2==0: print(h*w//2) else: print(h*w//2+1)
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354]]
5
58
import math n,w=map(int,input().split()) if h==1 or w==1: print(1) else: ans=math.ceil(w/2)*math.ceil(n/2)+(w//2)*(n//2) print(ans)
import math n,w=map(int,input().split()) if n==1 or w==1: print(1) else: ans=math.ceil(w/2)*math.ceil(n/2)+(w//2)*(n//2) print(ans)
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 22]]
5
68
h, w = gets.chomp.split.map(&:to_i) puts (h == 1 || w == 1)? "0" : (h * w + 1) / 2
h, w = gets.chomp.split.map(&:to_i) puts (h == 1 || w == 1)? "1" : (h * w + 1) / 2
[["-", 0, 652, 3, 4, 0, 754, 64, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 754, 64, 557, 0, 6]]
4
39
H,W = map(int,input().split()) ans = 0 ans += H//2*W if H % 2 == 0: print(ans) elif H or W == 1: print(1) else: if W % 2 == 0: ans += W//2 print(ans) else: ans += W//2+1 print(ans)
H,W = map(int,input().split()) ans = 0 ans += H//2*W if H % 2 == 0: print(ans) elif H == 1 or W == 1: print(1) else: if W % 2 == 0: ans += W//2 print(ans) else: ans += W//2+1 print(ans)
[["+", 0, 57, 75, 665, 15, 679, 31, 666, 667, 60], ["+", 0, 57, 75, 665, 15, 679, 31, 666, 0, 612]]
5
79
import math H,W=map(int,input().split()) if H==1 or W==1: print(1) else: print(H*W/2 if H*W%2==0 else H*W//2+1)
H,W=map(int,input().split()) if H==1 or W==1: print(1) else: print(H*W//2 if H*W%2==0 else H*W//2+1)
[["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 0, 652, 3, 4, 0, 41, 0, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 41, 0, 657, 17, 676]]
5
57
H, W = map(int, input().split()) if H==1 or W==1: print(0) else: if H%2==0: print(H*W//2) else: if W%2==0: print(H*W//2) else: print(H*W//2+1)
H, W = map(int, input().split()) if H==1 or W==1: print(1) else: if H%2==0: print(H*W//2) else: if W%2==0: print(H*W//2) else: print(H*W//2+1)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
75
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { ll H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << 0 << endl; } else { ll total = H * W; if ((H * W) % 2 == 1) { cout << (ll)total / 2 + 1 << endl; ...
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { ll H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << 1 << endl; } else { ll total = H * W; if ((H * W) % 2 == 1) { cout << (ll)total / 2 + 1 << endl; ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
106
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " int main() { int h, w; cin >> h >> w; if (h == 1 || w == 1) { co(1); retur...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; ++i) #define rep1(i, n) for (int i = 1; i <= n; ++i) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " int main() { ll h, w; cin >> h >> w; if (h == 1 || w == 1) { co(1); return...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
105
#include <bits/stdc++.h> using namespace std; int main() { long long H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << 0 << endl; } else if (H % 2 == 0 || W % 2 == 0) { cout << H * W / 2 << endl; } else { cout << (H * W + 1) / 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << 1 << endl; } else if (H % 2 == 0 || W % 2 == 0) { cout << H * W / 2 << endl; } else { cout << (H * W + 1) / 2 << endl; } return 0; }
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
89
h,w = map(int,input().split()) resp = h*w//2 if h == 1: print(1) else: if (h * w) % 2 != 0: resp += 1 print(resp) elif (h*w) % 2 == 0: print(resp)
h,w = map(int,input().split()) resp = h*w//2 if h == 1 or w == 1: print(1) else: if (h * w) % 2 != 0: resp += 1 print(resp) elif (h*w) % 2 == 0: print(resp)
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
67
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long h, w; h = sc.nextInt(); w = sc.nextInt(); long sum = 0; if (h == 1 || w == 1) { sum = 1; } else { if ((h % 2) == 0) { sum = (h / 2) * w; } e...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long h, w; h = sc.nextInt(); w = sc.nextInt(); long sum = 0; if (h == 1 || w == 1) { sum = 1; } else { if ((h % 2) == 0) { sum = (h / 2) * w; } ...
[["-", 12, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 16, 12, 16, 31, 23, 0, 16, 31, 22]]
3
161
H, W = [int(i) for i in input().split()] masu_sum = H * W if H == 1 | W == 1: ans = 1 elif masu_sum % 2 == 0: ans = masu_sum // 2 else: ans = masu_sum // 2 + 1 print(ans)
H, W = [int(i) for i in input().split()] masu_sum = H * W if H == 1 or W == 1: ans = 1 elif masu_sum % 2 == 0: ans = masu_sum // 2 else: ans = masu_sum // 2 + 1 print(ans)
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 139], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354]]
5
62
h,w = map(int,input().split(" ")) field = h*w if (h*w) % 2 == 0: answer = (h*w)//2 else: answer = (h*w)//2 + 1 if h == 1: answer = 0 elif w == 1: answer = 0 print(answer)
h,w = map(int,input().split(" ")) field = h*w if (h*w) % 2 == 0: answer = (h*w)//2 else: answer = (h*w)//2 + 1 if h == 1: answer = 1 elif w == 1: answer = 1 print(answer)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["-", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612]]
5
77
h,w = map(int,input().split()) c = 0 if w%2 == 0: c = (w//2)*h else: if h%2 == 0: c = (h//2)*w else: c = ((h//2)+1)*((w//2)+1)+(h//2)*(w//2) if h == 1 or w == 1: c = 0 print(c)
h,w = map(int,input().split()) c = 0 if w%2 == 0: c = (w//2)*h else: if h%2 == 0: c = (h//2)*w else: c = ((h//2)+1)*((w//2)+1)+(h//2)*(w//2) if h == 1 or w == 1: c = 1 print(c)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
104
H, W = map(int, input().split()) res = H * W if H == 1 or W == 1: ans = 1 if res % 2 == 0: ans = res // 2 else: ans = res//2+1 print(ans)
H, W = map(int, input().split()) res = H * W if H == 1 or W == 1: ans = 1 elif res % 2 == 0: ans = res // 2 else: ans = res//2+1 print(ans)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
58
H,W=map(int,input().split()) if H or W == 1: print(1) else: print(W*(H//2)+H%2*(W//2+W%2))
H,W=map(int,input().split()) if H == 1 or W == 1: print(1) else: print(W*(H//2)+H%2*(W//2+W%2))
[["+", 0, 656, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612]]
5
53
h, w = gets.split(" ").map(&:to_i) if h == 1 || w == 1 puts 1 elsif (h * w) % 2 == 0 puts h * w / 2 elsif puts ((h * w) - 1) / 2 end
h, w = gets.split(" ").map(&:to_i) if h == 1 || w == 1 puts 1 elsif (h * w) % 2 == 0 puts h * w / 2 elsif puts ((h * w) - 1) / 2 + 1 end
[["+", 75, 759, 15, 652, 3, 4, 0, 738, 17, 72], ["+", 75, 759, 15, 652, 3, 4, 0, 738, 12, 612]]
4
58
#coding:utf-8 h, w = map(int,input().split()) if h == 1 or w == 1: ans = 1 if (h * w) % 2 == 0: ans = h * w // 2 else: ans = (h * w + 1) // 2 print("{}".format(ans))
#coding:utf-8 h, w = map(int,input().split()) if h == 1 or w == 1: ans = 1 elif (h * w) % 2 == 0: ans = h * w // 2 else: ans = (h * w + 1) // 2 print("{}".format(ans))
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
71
n,m=map(int,input().split()) if m==1 or n==1: print(1) if m%2+n%2<2: print(n*m//2) else: print(n*(m//2)+(n//2+1))
n,m=map(int,input().split()) if m==1 or n==1: print(1) elif m%2+n%2<2: print(n*m//2) else: print(n*(m//2)+(n//2+1))
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
68
r, c = map(int, input().split()) if r == 1 or c==1: print(0) elif (r*c) % 2 != 0: print(((r*c)//2)+1) else: print(((r * c) // 2))
r, c = map(int, input().split()) if r == 1 or c==1: print(1) elif (r*c) % 2 != 0: print(((r*c)//2)+1) else: print(((r * c) // 2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
68
h, w = map(int, input().split()) if h == 1 or w == 1: print(0) exit() if h*w % 2 == 0: print(h*w//2) else: print((h*w+1)//2)
h, w = map(int, input().split()) if h == 1 or w == 1: print(1) exit() if h*w % 2 == 0: print(h*w//2) else: print((h*w+1)//2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
63
#include <bits/stdc++.h> using namespace std; int main() { long long h, w; cin >> h >> w; long long ans = h * w / 2 + (h * w % 2 == 1); if (h == 1 || w == 1) ans = 0; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long h, w; cin >> h >> w; long long ans = h * w / 2 + (h * w % 2 == 1); if (h == 1 || w == 1) ans = 1; cout << ans << endl; }
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13]]
1
64
def resolve(): H, W = map(int, input().split()) print(1) if H == W == 1 else print((H * W + 1) // 2) if __name__ == "__main__": resolve()
def resolve(): H, W = map(int, input().split()) print(1) if H == 1 or W == 1 else print((H * W + 1) // 2) if __name__ == "__main__": resolve()
[["+", 0, 1, 0, 41, 0, 679, 31, 666, 0, 612], ["+", 8, 196, 0, 1, 0, 41, 0, 679, 17, 354]]
5
54
M, N = map(int,input().split()) if M == 1 or N == 1: print(1) break if M * N % 2 == 1: print(M * N // 2 + 1) elif M* N % 2 == 0: print(M * N // 2)
M, N = map(int,input().split()) if M == 1 or N == 1: print(1) elif M * N % 2 == 1: print(M * N // 2 + 1) elif M* N % 2 == 0: print(M * N // 2)
[["-", 0, 656, 0, 57, 64, 196, 0, 93, 0, 94], ["-", 0, 656, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
66
#include <iostream> using namespace std; int main() { int h, w, ans; cin >> h >> w; if (h == 1 || w == 1) { cout << "0" << endl; return 0; } ans = h * w; if (ans % 2 == 1) cout << ans / 2 + 1 << endl; else cout << ans / 2 << endl; return 0; }
#include <iostream> using namespace std; int main() { long long int h, w, ans; cin >> h >> w; if (h == 1 || w == 1) { cout << "1" << endl; return 0; } ans = h * w; if (ans % 2 == 1) cout << ans / 2 + 1 << endl; else cout << ans / 2 << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
84
#6 h,w = map(int,input().split()) if h == 1 or w == 1: print(1) else: a = (h+1) // 2 #奇数列の列数 b = (w+1) // 2 #奇数列のマス目数 c = h // 2 #偶数列の列数 d = h // 2 #偶数列のマス目数 print(a*b+c*d)
#6 h,w = map(int,input().split()) if h == 1 or w == 1: print(1) else: a = (h+1) // 2 #奇数列の列数 b = (w+1) // 2 #奇数列のマス目数 c = h // 2 #偶数列の列数 d = w // 2 #偶数列のマス目数 print(a*b+c*d)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22]]
5
74
def main(): H, W = map(int, input().split()) ans = 0 if H == 1 and W == 1: ans = 1 else: ans = (H * W) // 2 if (H * W) % 2 == 1: ans += 1 print(ans) main()
def main(): H, W = map(int, input().split()) ans = 0 if H == 1 or W == 1: ans = 1 else: ans = (H * W) // 2 if (H * W) % 2 == 1: ans += 1 print(ans) main()
[["-", 0, 14, 8, 196, 0, 57, 15, 679, 17, 355], ["+", 0, 14, 8, 196, 0, 57, 15, 679, 17, 354]]
5
68
h, w = list(map(int, input().split())) print( (h*w) // 2 + (h*w) % 2 if h == 1 or w == 1 else 1)
h, w = list(map(int, input().split())) print( (h*w) // 2 + (h*w) % 2 if h != 1 and w != 1 else 1)
[["-", 3, 4, 0, 41, 0, 679, 31, 666, 667, 60], ["+", 3, 4, 0, 41, 0, 679, 31, 666, 667, 79], ["-", 0, 652, 3, 4, 0, 41, 0, 679, 17, 354], ["+", 0, 652, 3, 4, 0, 41, 0, 679, 17, 355], ["-", 3, 4, 0, 41, 0, 679, 12, 666, 667, 60], ["+", 3, 4, 0, 41, 0, 679, 12, 666, 667, 79]]
5
47
H, W = map(int, input().split()) if (H ==1)or(W==1): print(0) else: print(-(-H*W//2))
H, W = map(int, input().split()) if (H ==1)or(W==1): print(1) else: print(-(-H*W//2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
47
#include <bits/stdc++.h> using namespace std; int main() { long long H, W; cin >> H >> W; if (H * W == 1) { cout << 1 << endl; return 0; } if (H * W % 2 == 0) { cout << H * W / 2 << endl; } else { cout << (H * W + 1) / 2 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { long long H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << 1 << endl; return 0; } if (H * W % 2 == 0) { cout << H * W / 2 << endl; } else { cout << (H * W + 1) / 2 << endl; } }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
82
a, b = map(int, input().split()) if a == 1 or b == 1: print(1) elif a*b%2: (a*b+1)//2 else: (a*b)//2
a, b = map(int, input().split()) if a == 1 or b == 1: print(1) elif a*b%2: print((a*b+1)//2) else: print((a*b)//2)
[["+", 75, 665, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
54
a,b=map(int,input_line.split()) if a==1 or b==1: print (1) else: print (((a*b)+1)//2)
a,b=map(int,input().split()) if a==1 or b==1: print (1) else: print (((a*b)+1)//2)
[["-", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25]]
5
43
H,W=map(int,input().split()) if H==1 or W==1: print(0) else: print(-((-H*W)//2))
H,W=map(int,input().split()) if H==1 or W==1: print(1) else: print(-((-H*W)//2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
45
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) quit() ans = (math.ceil(W / 2) * math.ceil(H / 2)) + ((W // 2) * (H // 2)) print(ans)
import math H, W = map(int, input().split()) if H == 1 or W == 1: print(1) quit() ans = (math.ceil(W / 2) * math.ceil(H / 2)) + ((W // 2) * (H // 2)) print(ans)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
71
#include <stdio.h> int main(void) { long h, w; scanf("%ld %ld", &h, &w); long answer; long row; long column; if (h == 1 || w == 1) { printf("0\n"); return 0; } if (h % 2 == 0) { answer = h / 2; answer *= w; } else { row = h + 1; row /= 2; if (w % 2 == 0) { answer...
#include <stdio.h> int main(void) { long h, w; scanf("%ld %ld", &h, &w); long answer; long row; long column; if (h == 1 || w == 1) { printf("1\n"); return 0; } if (h % 2 == 0) { answer = h / 2; answer *= w; } else { row = h + 1; row /= 2; if (w % 2 == 0) { answer...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
162
h,w = map(int,input().split(" ")) if h == 1: print(1) exit() if h % 2 == 0: print((h // 2) * w) else: if w % 2 == 0: print((h // 2) * w + (w // 2)) else: print((h // 2) * w + (w // 2) + 1)
h,w = map(int,input().split(" ")) if h == 1 or w == 1: print(1) exit() if h % 2 == 0: print((h // 2) * w) else: if w % 2 == 0: print((h // 2) * w + (w // 2)) else: print((h // 2) * w + (w // 2) + 1)
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
93
#include <bits/stdc++.h> using namespace std; #define REP(i, N) for (int i = 0; i < (int)N; i++) #define RREP(i, N) for (int i = (int)N - 1; i >= 0; i--) #define FOR(i, a, b) for (int i = a; i < (int)b; i++) #define ALL(x) (x).begin(), (x).end() #define INF (1 << 30) #define LLINF (1LL << 62) #define DEBUG(...) debug...
#include <bits/stdc++.h> using namespace std; #define REP(i, N) for (int i = 0; i < (int)N; i++) #define RREP(i, N) for (int i = (int)N - 1; i >= 0; i--) #define FOR(i, a, b) for (int i = a; i < (int)b; i++) #define ALL(x) (x).begin(), (x).end() #define INF (1 << 30) #define LLINF (1LL << 62) #define DEBUG(...) debug...
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 85], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48]]
1
152
height,width = gets.split(" ").map{|i| i.to_i} if height == 1 puts "0" elsif width == 1 puts "0" elsif height*width%2 == 0 then puts height*width/2 else puts ((height-1)*width+(width+1))/2 end
height,width = gets.split(" ").map{|i| i.to_i} if height == 1 puts "1" elsif width == 1 puts "1" elsif height*width%2 == 0 then puts height*width/2 else puts ((height-1)*width+(width+1))/2 end
[["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6]]
4
73
# -*- coding: utf-8 -*- from sys import stdin from operator import itemgetter # stdin = open("sample.txt") h, w = [int(x) for x in stdin.readline().rstrip().split()] if h == 1 or w == 1: print(0) else: if h*w % 2 == 0: print(h*w // 2) else: print((h*w + 1) // 2)
# -*- coding: utf-8 -*- from sys import stdin from operator import itemgetter # stdin = open("sample.txt") h, w = [int(x) for x in stdin.readline().rstrip().split()] if h == 1 or w == 1: print(1) else: if h*w % 2 == 0: print(h*w // 2) else: print((h*w + 1) // 2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
82
H, W = map(int, input().split()) if H == 1 or W == 1: print(0) elif H % 2 == 0 or W % 2 == 0: print(W * H // 2) else: total = H * (W//2) + H//2 + 1 print(total)
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) elif H % 2 == 0 or W % 2 == 0: print(W * H // 2) else: total = H * (W//2) + H//2 + 1 print(total)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
71
h,w=map(int,input().split()) if (h-1)*(w-1)==0: print(1) else: print(-(-h*w)//2)
h,w=map(int,input().split()) if (h-1)*(w-1)==0: print(1) else: print(-(-h*w//2))
[["-", 3, 4, 0, 657, 31, 664, 28, 23, 0, 25], ["+", 0, 652, 3, 4, 0, 664, 28, 23, 0, 25]]
5
49
h,w = map(int,input(). split()) if (h == 1) or (w == 1): answer = 1 print(answer) elif (h%2 == 1) and (w%2 == 1): answer = (h*w+1)/2 print(answer) else: answer = h*w/2 print(answer)
h,w = map(int,input(). split()) if (h == 1) or (w == 1): answer = 1 print(answer) elif (h%2 == 1) and (w%2 == 1): answer = ((h*w)+1)//2 print(answer) else: answer = h*w//2 print(answer)
[["+", 12, 657, 31, 23, 0, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 31, 23, 0, 25], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 676], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676]]
5
81
h,w = [int(i) for i in input().split()] if h == 1 or w == 1: print(0) else: print(h * w // 2 + 1 if h * w % 2 else h * w //2 )
h,w = [int(i) for i in input().split()] if h == 1 or w == 1: print(1) else: print(h * w // 2 + 1 if h * w % 2 else h * w //2 )
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
57
H,W=map(int, input().split()) w1=W//2 h1=H//2 if W%2!=0: w2=W//2+1 else: w2=w1 if H%2!=0: h2=H//2+1 else: h2=h1 print(w1*h1+w2*h2 if (H!=1)&(W!=1) else 0)
H,W=map(int, input().split()) w1=W//2 h1=H//2 if W%2!=0: w2=W//2+1 else: w2=w1 if H%2!=0: h2=H//2+1 else: h2=h1 print(w1*h1+w2*h2 if (H!=1)&(W!=1) else 1)
[["-", 0, 1, 0, 652, 3, 4, 0, 41, 0, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 41, 0, 612]]
5
88
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (int)n; i++) #define PI acos(-1) #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (int)n; i++) #define PI acos(-1) #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 17, 85], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 31, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
106
import sys input = sys.stdin.readline H, W = list(map(int,input().split())) if H==1 or W==1: print(1) exit(0) ans =int((H*W) // 2) print(ans)
import sys input = sys.stdin.readline H, W = list(map(int,input().split())) if H==1 or W==1: print(1) exit(0) ans =int((H*W+1) // 2) print(ans)
[["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612]]
5
61
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef int itn; const...
#include <algorithm> #include <cmath> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef int itn; const...
[["-", 0, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 17, 48]]
1
457
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> using namespace std; int main() { long long H, W; cin >> H >> W; if (H == 1 && W == 1) { cout << "1" << endl; } else if (H * W % 2 == 0) { cout << H * W / 2 << endl; } else...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> using namespace std; int main() { long long H, W; cin >> H >> W; if (H == 1 || W == 1) { cout << "1" << endl; } else if (H * W % 2 == 0) { cout << H * W / 2 << endl; } else...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
99
h, w = map(int, input().split()) if h==1 or w==1: #コーナーケース print(1) elif h%2 != w%2 != 0: #両者奇数 print(h*w//2 + 1) else: print(h*w//2)
h, w = map(int, input().split()) if h==1 or w==1: #コーナーケース print(1) elif h%2 != 0 and w%2 != 0: #両者奇数 print(h*w//2 + 1) else: print(h*w//2)
[["+", 0, 57, 75, 665, 15, 679, 31, 666, 0, 612], ["+", 0, 656, 0, 57, 75, 665, 15, 679, 17, 355]]
5
62
h, w = map(int, input().split()) if(h == 1 or w == 1): print(1) else: if(h*w % 2 == 0): print(h*w//2) else: print(h*w//2)
h, w = map(int, input().split()) if(h == 1 or w == 1): print(1) else: if(h*w % 2 == 0): print(h*w//2) else: print(h*w//2+1)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
62
H, W = map(int, input().split()) HW = H * W HW2 = HW // 2 if HW == 1: ans = 1 else: if HW % 2 == 0: ans = HW2 else: ans = HW2 + 1 print(ans)
H, W = map(int, input().split()) HW = H * W HW2 = HW // 2 if H == 1 or W == 1: ans = 1 else: if HW % 2 == 0: ans = HW2 else: ans = HW2 + 1 print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22]]
5
57
h, w = map(int, input().split()) print(1 if h == w == 1 else (h*w+1)//2)
h, w = map(int, input().split()) print(1 if h == 1 or w == 1 else (h*w+1)//2)
[["+", 3, 4, 0, 41, 0, 679, 31, 666, 0, 612], ["+", 0, 652, 3, 4, 0, 41, 0, 679, 17, 354]]
5
36
H,W = map(int,input().split()) if H == 1 or W == 1: return 1 else: cnt = (H * W + 1) // 2 return cnt
H,W = map(int,input().split()) if H == 1 or W == 1: print(1) else: cnt = (H * W + 1) // 2 print(cnt)
[["-", 0, 656, 0, 57, 64, 196, 0, 37, 0, 38], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 0, 57, 75, 76, 8, 196, 0, 37, 0, 38], ["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196...
5
42
h,w = map(int, input().split()) if h == 1 or w==1: print(1) else: print(h*w//2)
h,w = map(int, input().split()) if h == 1 or w==1: print(1) else: print((h*w+1)//2)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
39
a,b=list(map(int, input().split())) if a==1 or b==1: print(0) elif a*b%2==0: print(a*b//2) else: print(-(-a*b//2))
a,b=list(map(int, input().split())) if a==1 or b==1: print(1) elif a*b%2==0: print(a*b//2) else: print(-(-a*b//2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
63
#n=int(input()) h,w=map(int,input().split()) #l=list(map(int,input().split())) #l=[list(map(int,input().split())) for i in range(n)] m=h//2 n=w//2 if h==1 or w==1: ans=0 elif h%2==0: ans=m*w else: md=w%2 ans=n*(m+1+m)+md*(m+1) print(ans)
#n=int(input()) h,w=map(int,input().split()) #l=list(map(int,input().split())) #l=[list(map(int,input().split())) for i in range(n)] m=h//2 n=w//2 if h==1 or w==1: ans=1 elif h%2==0: ans=m*w else: md=w%2 ans=n*(m+1+m)+md*(m+1) print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
83
H , W = map(int , input().split()) if H == 1: print(1) elif(H * W ) % 2 == 0: print((H * W) // 2) else: print((H * W) // 2 + 1 )
H , W = map(int , input().split()) if H == 1 or W == 1: print(1) elif(H * W ) % 2 == 0: print((H * W) // 2) else: print((H * W) // 2 + 1 )
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
60
x,y = map(int,input().split()) if x == 1 or y == 1: print(0) else: print(-(-(x*y)//2))
x,y = map(int,input().split()) if x == 1 or y == 1: print(1) else: print(-(-(x*y)//2))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
45
h, w = map(int, input().split()) if w == 1: print(0) exit() if h * w %2 == 0: print (h*w//2) else: print(((h*w)//2)+ 1)
h, w = map(int, input().split()) if w == 1 or h == 1: print(1) exit() if h * w %2 == 0: print (h*w//2) else: print(((h*w)//2)+ 1)
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
61
H, W = map(int, input().split()) ans = H * W // 2 if H == 1 or W == 1: ans = 0 elif (H & 1) and (W & 1): ans += 1 print(ans)
H, W = map(int, input().split()) ans = H * W // 2 if H == 1 or W == 1: ans = 1 elif (H & 1) and (W & 1): ans += 1 print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
55
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; int main() { ll h, w; cin >> h >> w; ll cnt = 0; if (!(h == 1 || w == 1)) { if (h * w % 2 == 1) { cnt = h * w / 2 + 1; } else { cnt = h * w / 2; } } cout << cnt; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; int main() { ll h, w; cin >> h >> w; ll cnt = 1; if (!(h == 1 || w == 1)) { if (h * w % 2 == 1) { cnt = h * w / 2 + 1; } else { cnt = h * w / 2; } } cout << cnt; }
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
94
#input H, W = map(int, input().split()) #output if (H-1)*(W-1) == 0: print(0) else: print((H*W+1)//2)
#input H, W = map(int, input().split()) #output if (H-1)*(W-1) == 0: print(1) else: print((H*W+1)//2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
51
h, w = map(int, input().split()) if h == 1 or w == 1: ans = 1 if h % 2 == 0: ans = h//2 * w elif w % 2 == 0: ans = w//2 * h else: hh = h // 2 wh = w // 2 ans = (hh + 1) * (wh + 1) + hh * wh print(ans)
h, w = map(int, input().split()) if h == 1 or w == 1: ans = 1 elif h % 2 == 0: ans = h//2 * w elif w % 2 == 0: ans = w//2 * h else: hh = h // 2 wh = w // 2 ans = (hh + 1) * (wh + 1) + hh * wh print(ans)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683]]
5
89
h,w=map(int,input().split()) if h==1: print(1) else: print((h*w)//2 if h%2==0 else ((h-1)*w)//2-(-w//2))
h,w=map(int,input().split()) if h==1 or w==1: print(1) else: print((h*w)//2 if h%2==0 else ((h-1)*w)//2-(-w//2))
[["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612]]
5
62
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) else: count = W // 2 * H if H & 1: count += (H + 1) // 2 print(count)
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) else: count = W // 2 * H if W & 1: count += (H + 1) // 2 print(count)
[["-", 75, 76, 8, 196, 0, 57, 15, 657, 31, 22], ["+", 75, 76, 8, 196, 0, 57, 15, 657, 31, 22]]
5
56
H,W=map(imt,input().split()) if H==1 or W==1: print(1) else: print((H*W+1)//2)
H,W=map(int,input().split()) if H==1 or W==1: print(1) else: print((H*W+1)//2)
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
43
H, W = map(int, input().split()) if H==0 or W==0: print(0) elif H%2==0 or W%2==0: print((H*W)//2) else: print((H*(W-1))//2+H//2+1)
H, W = map(int, input().split()) if H==1 or W==1: print(1) elif H%2==0 or W%2==0: print((H*W)//2) else: print((H*(W-1))//2+H//2+1)
[["-", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["-", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["+", 0, 656, 0, 57, 15, 679, 12, 666, 0, 612], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
74
n, m = map(int, input().split()) k=n*m+1 if n==1 or m==1: print(0) exit() else: print((k)//2)
n, m = map(int, input().split()) k=n*m+1 if n==1 or m==1: print(1) exit() else: print((k)//2)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
49
H, W = map(int, input().split()) if H == W == 1: print(1) else: print(-((-H*W)//2))
H, W = map(int, input().split()) if H == 1 or W == 1: print(1) else: print(-((-H*W)//2))
[["+", 0, 656, 0, 57, 15, 679, 31, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354]]
5
43
import sys import math def i():return int(sys.stdin.readline().replace("\n","")) def i2():return map(int,sys.stdin.readline().replace("\n","").split()) def s():return str(sys.stdin.readline().replace("\n","")) def l():return list(sys.stdin.readline().replace("\n","")) def intl():return [int(k) for k in sys.stdin.readli...
import sys import math def i():return int(sys.stdin.readline().replace("\n","")) def i2():return map(int,sys.stdin.readline().replace("\n","").split()) def s():return str(sys.stdin.readline().replace("\n","")) def l():return list(sys.stdin.readline().replace("\n","")) def intl():return [int(k) for k in sys.stdin.readli...
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
281
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { long double H, W; cin >> H >> W; cout << (H == 1 || W == 1 ? 0 : (long long)ceil(H * W / 2)) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int main() { long double H, W; cin >> H >> W; cout << (H == 1 || W == 1 ? 1 : (long long)ceil(H * W / 2)) << endl; return 0; }
[["-", 0, 16, 31, 16, 12, 23, 0, 41, 64, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 41, 64, 13]]
1
64
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define fin(x) cout << x << endl; using namespace std; using ll = long long; int main(void) { ll h, w; cin >> h >> w; if (h == 1 || w == 1) { fin(1); return 0; } else if (h % 2 == 0 || ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define fin(x) cout << x << endl; using namespace std; using ll = long long; int main(void) { ll h, w; cin >> h >> w; if (h == 1 || w == 1) { fin(1); return 0; } else if (h % 2 == 0 || ...
[["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
133
h, w = map(int, input().split()) if(h == 1 and w == 1): print(1) exit() a = (w // 2) * h b = -(-(w % 2) * h // 2) print(a + b)
h, w = map(int, input().split()) if(h == 1 or w == 1): print(1) else: a = (w // 2) * h b = -(-(w % 2) * h // 2) print(a + b)
[["-", 0, 656, 0, 57, 15, 23, 0, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 23, 0, 679, 17, 354], ["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]]
5
64
h, w = map(int, input().split()) if(h == 1 and w == 1): print(1) else: cCol = -(-w // 2) cRow = -(-h // 2) fCol = w - cCol fRow = h - cRow print(cRow * cCol + fRow * fCol)
h, w = map(int, input().split()) if(h == 1 or w == 1): print(1) else: cCol = -(-w // 2) cRow = -(-h // 2) fCol = w - cCol fRow = h - cRow print(cRow * cCol + fRow * fCol)
[["-", 0, 656, 0, 57, 15, 23, 0, 679, 17, 355], ["+", 0, 656, 0, 57, 15, 23, 0, 679, 17, 354]]
5
71
H,W=map(int,input().split()) if H==1 or W==1: c=0 elif H*W%2==0: c=H*W//2 else:c=H*W//2+1 print(c)
H,W=map(int,input().split()) if H==1 or W==1: c=1 elif H*W%2==0: c=H*W//2 else:c=H*W//2+1 print(c)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
59
#include <algorithm> #include <iostream> using namespace std; using ll = long long; int main() { ll h, w; cin >> h >> w; if (h == 1 && w == 1) { cout << 1 << endl; return 0; } ll ans; if (h % 2 == 0 || w % 2 == 0) { ans = (h * w) / 2; } else { // odd, odd // ans = h * (w + 1LL) / 2 - ((...
#include <iostream> using namespace std; using ll = long long; int main() { ll h, w; cin >> h >> w; if (h == 1 || w == 1) { cout << 1 << endl; return 0; } ll ans; if (h % 2 == 0 || w % 2 == 0) { ans = (h * w) / 2; } else { ans = (h * w + 1) / 2; } cout << ans << endl; }
[["-", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106]]
1
104
h,w=map(int,input().split()) if h == 1 or w == 1: print(1) elif h%2 == 0 or w%2 == 0: print(h*w/2) else: print(int(h*w/2)+1)
h,w=map(int,input().split()) if h == 1 or w == 1: print(1) elif h%2 == 0 or w%2 == 0: print(h*w//2) else: print(h*w//2+1)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["-", 0, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["-", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 657, 31, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 676], ["-", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25]]
5
65
h, w = map(int, input().split()) if h ==1 and w == 1: ans = 1 else: ans = (h * w + 1) // 2 print(ans)
h, w = map(int, input().split()) if h ==1 or w == 1: ans = 1 else: ans = (h * w + 1) // 2 print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 679, 17, 354]]
5
45