qyliang/CodeNanoFix huggingface dataset:
Buggy code:
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)

Fixed code:
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)
Buggy code:
h,w = map(int,input().split())

if h == 1 or w == 1:
    ans = 1
else:
    if (h*w) % 2 == 0:
        ans = h*w/2
    else:
        ans = h*w//2 +1
        
print(ans)

Fixed code:
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)
Buggy code:
H,W = map(int, input().split())

if H * W % 2 == 0:
    print( (H * W) /2 )
else:
    print((H * W) / 2 + 1)


Fixed code:
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)
Buggy code:
# -*- 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)

Fixed code:
# -*- 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)
Buggy code:
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+1)/2)


Fixed code:
h,w = map(int, input().split())
S=h*w
if h==1 or w==1:
    print(1)
elif S%2==0:
    print(S//2)
else:
    print(S//2+1)
Buggy code:
N, M = map(int, input().split())
K=N*M
if N==1orM==1:
  print(1)
elif K%2==1:
  print(K//2+1)
else:
  print(K//2)

Fixed code:
N, M = map(int, input().split())
K=N*M
if N==1 or M==1:
  print(1)
elif K%2==1:
  print(K//2+1)
else:
  print(K//2)
Buggy code:
H, W = map(int, input().split())
ans = H * W
if ans % 2 == 1:
    print(ans // 2 + 1)
else:
    print(ans // 2

Fixed code:
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
else:
    if (H*W)%2==1:
        print((H*W+1)//2)
    else:
        print((H*W)//2)
Buggy code:
h,w=map(int,input().split())
if h=1 or w==1:
  print("1")
elif h%2==0:
    print((h*w)//2)
elif w%2==0:
    print((h*w)//2)
else:
    print((w*(h//2))+(w//2)+1)

Fixed code:
h,w = map(int,input().split())

if h == 1:
    print(1)
elif w == 1:
    print(1)
elif h%2 == 0:
    print(w*(h//2))
else:
    if w%2 == 0:
        print((w*(h//2)) + (w//2))
    else:
        print((w*(h//2)) + ((w//2)+1))
Buggy code:
h,w = list(map(int, input().split()))

print((h*w // 2)+ (h*w % 2 != 0) if h != w else (h*w // 2) + 1 )


Fixed code:
h,w = list(map(int, input().split()))

print((w//2)*h + (h//2 + (h%2 != 0))*(w % 2 != 0) if w != 1 and h != 1 else 1)
Buggy code:
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 print((H*W)//2+1)

Fixed code:
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 // 2 + 1)
Buggy code:
H,W=map(int,input().split())
if H%2==1 and W%2==1:
    print((H*W+1)/2)
else:
    print(H*W/2)

Fixed code:
H,W=map(int,input().split())
if H!=1 and W!=1:
    print((H*W+1)//2)
else:
    print(1)
Buggy code:
def resolve():
    '''
    code here
    '''
    H, W = [int(item) for item in input().split()]

    if H == 1 or W == 1:
        res = 1
    elif H % 2 == 1 and W % 2 == 1:
        res += H * W // 2 +1
    else:
        res = H * W // 2

    print(res)
if __name__ == "__main__":
    resolve()


Fixed code:
def resolve():
    '''
    code here
    '''
    H, W = [int(item) for item in input().split()]

    if H == 1 or W == 1:
        res = 1
    elif H % 2 == 1 and W % 2 == 1:
        res = H * W // 2 +1
    else:
        res = H * W // 2

    print(res)
if __name__ == "__main__":
    resolve()
Buggy code:
h, w = map(int, input().split())
import math
if h == 1 or w == 1:
  print(1)
  
elif h%2 == 0 and w%2 == 0:
  print(h * w // 2)
  
else:
  if h%2 == 0:
    we = w//2
    wo = math.ceil(w/2)
    print(we * h//2 + wo * h//2)
  
  else:
    he = h//2
    ho = math.ceil(h/2)
    print(ho * w//2 + he * w//2)
    
  
  

Fixed code:
h, w = map(int, input().split())
import math
if h == 1 or w == 1:
  print(1)
  
elif h%2 == 0 and w%2 == 0:
  print(h * w // 2)
  
elif h%2 == 0 or w%2 == 0:
  if h%2 == 0:
    we = w//2
    wo = math.ceil(w/2)
    print(we * h//2 + wo * h//2)
    
  else:
    he = h//2
    ho = math.ceil(h/2)
    print(ho * w//2 + he * w//2)

else:
  	# odd
	we = w//2
	wo = math.ceil(w/2)
	he = h//2
	ho = math.ceil(h/2)
	print(ho * wo + he * we)
Buggy code:
h,w = map(int,input().split())
print(h * w / 2 if h % 2 == 0 or w % 2 == 0 else h * w // 2 + 1)

Fixed code:
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)
Buggy code:
import math
H, W = map(int, input().split())
ans = 0
if W % 2 == 0:
    f, n = W // 2, W // 2
else:
    f = math.ceil(W / 2)
    n = f - 1

if H % 2 == 0:
    kakeru = H // 2
    ans += f * kakeru + n * kakeru
else:
    kakeru = math.ceil(H / 2)
    n_kakeru = H - (H // 2)
    ans += f * kakeru + n * n_kakeru
print(ans)

Fixed code:
import math
H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
    exit()

if W % 2 == 0:
    f, n = W // 2, W // 2
else:
    f = math.ceil(W / 2)
    n = f - 1

if H % 2 == 0:
    kakeru = H // 2
    print(f * kakeru + n * kakeru)
    exit()
else:
    kakeru = H // 2
    n_kakeru = H - kakeru
    print((f * n_kakeru) + (n * kakeru))
    exit()
Buggy code:
import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if: H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)

Fixed code:
import math
H, W = map(int, input().split())

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)
Buggy code:
import math

H, W = map(int, input().split())

o = math.ceil(W/2)
e = W//2

if H % 2 == 0:
    print((o+e)*H//2)
else:
    print((o+e)*H//2 + o)


Fixed code:
import math

H, W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
else:
    o = math.ceil(W/2)
    e = W//2

    if H % 2 == 0:
        print((o+e)*(H//2))
    else:
        print((o+e)*(H//2) + o)
Buggy code:
h,w=map(int,input().split())
if h or w ==1:
    print(1)
else:
    
    if h%2==0:
        hk=h//2
        hg=h//2
    else:
        hk=h//2+1
        hg=h//2
    if w%2==0:
        wk=w//2
        wg=w//2
    else:
        wk=w//2+1
        wg=w//2
    print((hk*wk)+(hg*wg))

Fixed code:
h,w=map(int,input().split())
if h ==1 or w==1:
    print(1)
else:
    if h%2==0:
        hk=h//2
        hg=h//2
    else:
        hk=h//2+1
        hg=h//2
    if w%2==0:
        wk=w//2
        wg=w//2
    else:
        wk=w//2+1
        wg=w//2
    print((hk*wk)+(hg*wg))
Buggy code:
w,h = map(int, input().split())
x = w*h

if x%2 == 0:
    print(x/2)
else:
    print(x//2+1)

Fixed code:
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)
Buggy code:
h, w = map(int, input().split())

if h == 1 or w == 1:
    print(1)
print(h * w + 1 // 2)

Fixed code:
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
else:
    print((h * w + 1) // 2)
Buggy code:
h, w=map(int, input().split())
if h == 1 and w ==:
    print(1)
elif w == 1:
    print(1)
elif (h * w) % 2 ==1:
    print(int((h * w //2) + 1))
else:
    print(int(h * w //2))

Fixed code:
h, w=map(int, input().split())
if h == 1 or w ==1:
    print(1)
elif (h * w) % 2 ==1:
    print(int((h * w //2) + 1))
else:
    print(int(h * w //2))
Buggy code:
h, w =map(int,input().split())

if h == 1 or w == 1:
  print(1)
else:
  if (h * w) % 2 == 0:
    print((h * w) // 2)
  elif:
    print(((h * W) // 2) + 1)
  


Fixed code:
h, w = map(int, input().split())

num = h * w

if h == 1 or w == 1:
    print(1)
elif num % 2 == 0:
    print(num // 2)
else:
    print(num // 2 + 1)
Buggy code:
h,w=map(int,input().split())
if (h-1)*(w-1)==0:
  print(1)
else:
  print(-(-h*w)//2)

Fixed code:
h,w=map(int,input().split())
if (h-1)*(w-1)==0:
  print(1)
else:
  print(-(-h*w//2))
Buggy code:
def main():
    import sys
    input = sys.stdin.readline

    h,w = map(int,input().split())

    if (h * w) % 2 == 0:
        print(int((h * w)//2))
    else:
        s1 = (((h-1) * w)//2)
        s2 = (w//2) + 1
        print(s1)
        print(s2)
        print(s1 + s2)


if __name__ == "__main__":
    main()

Fixed code:
def main():
    import sys
    input = sys.stdin.readline

    h,w = map(int,input().split())

    if (h == 1) or (w == 1):
        print(1)
    elif (h * w) % 2 == 0:
        print(int((h * w)//2))
    else:
        s1 = (((h-1) * w)//2)
        s2 = (w//2) + 1
        print(int(s1 + s2))


if __name__ == "__main__":
    main()
Buggy code:
H,W = map(int,input().split()) 
if H%2 ==0:
    print(H//2*W)
else:
    if W%2 == 0:
        print((H//2+(H+1)//2)*(W//2)
    else:
        print((H//2+(H+1)//2)*(W//2)+(H+1)//2)

Fixed code:
H, W = map(int, input().split())

ans = 0

if H % 2 == 0:
    ans += (H // 2)*W
else:
    if W % 2 == 0:
        ans += ((H // 2) + 1)*(W//2)
        ans += (H // 2)*(W//2)
    else:
        ans += ((H // 2) + 1)*((W // 2) + 1)
        ans += (H // 2)*(W//2)
    
if H == 1 or W == 1:
    ans = 1

print(ans)
Buggy code:
h, w = input().split()
h = int(h)
w = int(w)

s = h * w

if s % 2:
    print(s//2+1)
else:
    print(s/2)

Fixed code:
h, w = input().split()
h = int(h)
w = int(w)

if h == 1 or w == 1:
    print(1)
    exit()

s = h * w

if s % 2:
    print(s//2+1)
else:
    print(s//2)
Buggy code:
h, w = map(int, input().split())

if h == 1 or w == 1:
    print(1)
else:
    H = (h+1)//2
    W = (w+1)//2

    print(H*W + (h-H)*(w-W))

    print(((h*w+1)//2))


Fixed code:
h, w = map(int, input().split())

if h == 1 or w == 1:
    print(1)
else:
    # H = (h+1)//2
    # W = (w+1)//2
    #
    # print(H*W + (h-H)*(w-W))

    print(((h*w+1)//2))
Buggy code:
H, W = map(int, input().split())
if H * W % 2 == 0:
    print(H * W / 2)
else:
    print((H * W + 1) / 2)


Fixed code:
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)
Buggy code:
import sys
input = sys.stdin.readline

H, W = [int(x) for x in input().split()]
ans = 0

if H == 1 and W == 1:
    print(1)
    sys.exit()

if H == 1:
    print(W // 2 + int(W % 2 == 1))
    sys.exit()

if W == 1:
    print(H // 2 + int(H % 2 == 1))
    sys.exit()

# type2
b = H // 2

# type1
a = H - b

ans += a * (W // 2)
ans += b * (W - (W // 2))

print(ans)





Fixed code:
import sys
input = sys.stdin.readline

H, W = [int(x) for x in input().split()]
ans = 0

if H == 1 and W == 1:
    print(1)
    sys.exit()

if H == 1 or W == 1:
    print(1)
    sys.exit()

# type2
b = H // 2

# type1
a = H - b

ans += b * (W // 2)
ans += a * (W - (W // 2))

print(ans)
Buggy code:
import math
H, W = map(int, input().split())

ans = 0

if H%2 == 0:
  len = H/2
  ans += math.ceil(W/2)*len + math.floor(W/2)*len
else:
  len = H/2
  ans += math.ceil(W/2)*(len+1) + math.floor(W/2)*len
  
print(int(ans))

Fixed code:
import math
H, W = map(int, input().split())
 
ans = 0

if H==1 or W==1:
  print(1)
  exit()

if H%2 == 0:
  len = int(H/2)
  ans += int(math.ceil(W/2))*len + int(math.floor(W/2))*len
else:
  len = int(math.floor(H/2))
  ans += int(math.ceil(W/2))*(len+1) + int(math.floor(W/2))*len
  
print(int(ans))
Buggy code:
H,W = map(int,input().split())
import math
if H%2==0:
  print((H//2)*W)
else:
  print(((H//2)-1)*W+math.ceil(W/2))

Fixed code:
H,W = map(int,input().split())
import math
if (H==1)or(W==1):
  print(1)
elif H%2==0:
  print((H//2)*W)
else:
  print(((H-1)//2)*W+math.ceil(W/2))
Buggy code:
H,W=map(int,input().split())
if W%2==0:
    print(int((W/2)*H))
else:
    if H%2==0:
        print(int((W-1)/2+1+(W-1)/2)*H/2)
    else:
        print(int(((W-1)/2+1+(W-1)/2)*(H-1)/2+(W-1)/2+1))

Fixed code:
H, W = map(int, input().split())
if H == 1 or W == 1:
  print(1)
elif (H % 2 == 0):
  print(H * W // 2)
else:
  print(((H -1) * W // 2) + (W //2) + W % 2)
Buggy code:
H, W = map(int, input().split())

if (H * W) % 2 == 0:
  print(H*W//2)
else:
  print((H*W+1//2))

Fixed code:
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+1)//2)
Buggy code:
def Main(H, W):
    if W%2:
        if H%2:
            return H*(W//2)+(W//2+1)
        else:
            return H*(W//2)
    else:
        if H%2:
            return H*(W//2)+W//2
        else:
            return H*(W//2)
                

def main():
    H, W = map(int, input().split())
    print(Main(H, W))

if __name__ == '__main__':
    main()

Fixed code:
def Main(H, W):
    if H == 1 or W == 1:
        return 1
    else:    
        if W%2:
            if H%2:
                return W*(H//2)+(W//2+1)
            else:
                return W*(H//2)
        else:
            if H%2:
                return W*(H//2)+W//2
            else:
                return W*(H//2)
                

def main():
    H, W = map(int, input().split())
    print(Main(H, W))

if __name__ == '__main__':
    main()
Buggy code:
H,W=map(int,input().split()))
if H == 1 or W == 1:
  print(0)
else:
  print((H*W+1)//2)

Fixed code:
H,W = map(int,input().split())

if H == 1 or W == 1:
    print(1)
else:
    print(W*(H//2)+((W+1)//2)*(H%2))
Buggy code:
H,W = map(int,input().split())

if (H == 1)or(W == 1):
    sum = 1
else:
    if H % 2 == 0:
        sum = W * H / 2
    elif W % 2 == 0:
        sum = (W * (H-1) / 2) + (W / 2)
    else:
        sum = (W * (H-1) / 2) + ((W+1) / 2)
print(sum)

Fixed code:
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+1)//2)
Buggy code:
H, W = map(int,input().split())

if H % 2 == 0:
    sum = W * H / 2
elif W % 2 == 0:
    sum = (W * (H-1) / 2) + (W / 2)
else:
    sum = (W * (H-1) / 2) + ((W+1) / 2)

print(sum)    

Fixed code:
H,W = map(int,input().split())
 
if (H == 1)or(W == 1):
    sum = 1
elif H % 2 == 0:
    sum = W * H // 2
elif W % 2 == 0:
    sum = (W * (H-1) // 2) + (W // 2)
else:
    sum = (W * (H-1) // 2) + ((W+1) // 2)
 
print(int(sum))
Buggy code:
import sys
H,W = map(int,input().split())
if H==1 or W==1:
    print(1)
sys.exit()
if H*W%2==0:
    print(H*W//2)
else:
    print(H*W//2+1)



Fixed code:
import sys
H,W = map(int,input().split())
if H==1 or W==1:
    print(1)
    sys.exit()
if H*W%2==0:
    print(H*W//2)
else:
    print(H*W//2+1)
Buggy code:
A, B = map(int, input().split())
if A*B%2 == 0:
  print(A*B/2)
else:
  print(A*B//2+1)

Fixed code:
A, B = 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+1)
Buggy code:
H, W = map(int, input().split())

if (H + W) % 2 == 0:
  N = (H * W) // 2 + 1
else:
  N = (H * W) // 2

print(N)

Fixed code:
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)
Buggy code:
h, w = map(int, input().split())
s = h*w
if s%2 == 0:
  print(int(s/2))
if s == 2 or s == 1:
  print(0)
else:
  print(int(s/2 + 1))

Fixed code:
h,w=map(int,input().split())
s=h*w
if h==1 or w==1:
  print(1)
elif s%2==0:
  print(s//2)
else:
  print(s//2+1)
Buggy code:
# coding: utf-8

H, W = map(int, input().split())
h_even= H//2
h_odd= H-h_even
w_even= W//2
w_odd= W-w_even


# if H%2 == 1:
#     r1=r+1
#     print(r*W//2+r1*(W-W//2))
# else:
#     print(r*W//2+r*(W-W//2))
print(h_odd*w_odd+h_even*w_even-1)


Fixed code:
# coding: utf-8

H, W = map(int, input().split())

if H ==1 or W == 1:
    print(1)
else:
    h_even= H//2
    h_odd= H-h_even
    w_even= W//2
    w_odd= W-w_even


    # if H%2 == 1:
    #     r1=r+1
    #     print(r*W//2+r1*(W-W//2))
    # else:
    #     print(r*W//2+r*(W-W//2))

    # if H%2==1 or W%2==1:
    #     print(h_odd*w_odd+h_even*w_even-1)
    # else:
    #     print(h_odd*w_odd+h_even*w_even)
    print(h_odd*w_odd+h_even*w_even)
Buggy code:
h,w=map(int,input().split())
m=h*w
if h or w == 1:
    ans=1
else:
    if m%2==0:
        ans=m//2
    else:
        ans=(m+1)//2
print(ans)

Fixed code:
h,w=map(int,input().split())
ans=h*w
if h==1 or w==1:
    print(1)
    exit(0)
if ans%2==0:
    print(ans//2)
else:
    print(1+(ans//2))
Buggy code:
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


Fixed code:
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)
Buggy code:
h,w=map(int,input().split())
if h==1 ir w==1:
    print(1)
else:
    print((h*w)//2 if h%2==0 else ((h-1)*w)//2-(-w//2))

Fixed code:
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))
Buggy code:
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)

Fixed code:
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)
Buggy code:
import math
h, w = map(int, input().split())

if h % 2 == 0 or w % 2 ==0:
  print(h * w / 2)
else:
  print(((h * w) // 2) + 1)

Fixed code:
import math
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)
Buggy code:
import math
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)

Fixed code:
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)
Buggy code:
a,b = map(int, input().split())
if a or b == 1:
    print(1)
    exit()
if a*b%2 == 0:
    print(a*b//2)
else:
    print(a*b//2 + 1)

Fixed code:
a,b = map(int, input().split())
if a == 1:
    print(1)
    exit()
if b == 1:
    print(1)
    exit()
if a*b%2 == 0:
    print(a*b//2)
if a*b%2 == 1:
    print(a*b//2 + 1)
Buggy code:
def main():
    w, h = map(int, input().split())

    h1 = (h + 1) // 2
    h2 = h // 2

    print(h1, h2)
    if w % 2 == 1:
        #print((w // 2 + 1), w // 2)
        print(h1 * (w // 2 + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * w // 2)


if __name__ == "__main__":
    main()


Fixed code:
def main():
    w, h = map(int, input().split())

    if w == 1 or h == 1:
        print(1)
        exit()

    h1 = (h + 1) // 2
    h2 = h // 2

    if (w % 2) == 1:
        print(h1 * ((w // 2) + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * (w // 2))


if __name__ == "__main__":
    main()
Buggy code:
H,W=map(int,input().split())
if H % 2 != 0 and W % 2 != 0:
  	if H == 1 or W == 1:
      	print(1)
    else:
		print(int((H*W/2)+1))
else:
  	print(int(H*W/2))

Fixed code:
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)
Buggy code:
h, w=map(int, input().split())
if h==1 or w==1:
  print(1)
else:
  ans=(h*w)///2
  if h*w%2==1:
    print(ans+1)
  else:
    print(ans)

Fixed code:
h, w=map(int, input().split())
if h==1 or w==1:
  print(1)
else:
  ans=(h*w)//2
  if h*w%2==1:
    print(ans+1)
  else:
    print(ans)
Buggy code:
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)

Fixed code:
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)
Buggy code:
import math
H, W = map(int, input().split())
if H != W != 1:
  print(math.floor(H/2)*math.floor(W/2)+math.ceil(H/2)*math.ceil(W/2))
else:
  print(1)

Fixed code:
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
  print(1)
else:
  print(math.floor(H/2)*math.floor(W/2)+math.ceil(H/2)*math.ceil(W/2))
Buggy code:
def main():
    h, w = map(int, input().split())

    ans = 0
    if h == 1:
        print(1)
        return 0
    if w&1:
    ans += w * (h//2)
    if h % 2 == 1:
        ans += (w+1)//2
    else:
    ans += h*(w//2)

    print(ans)

main()


Fixed code:
def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        return 0
    ans = 0
    if w&1:
        ans += w * (h//2)
        if h % 2 == 1:
            ans += (w+1)//2
    else:
        ans += h*(w//2)

    print(ans)

main()
Buggy code:
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    print(H*W//2)

Fixed code:
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
else:
    print((H*W+1)//2)
Buggy code:
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)

Fixed code:
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)
Buggy code:
h,w = map(int, input().split())
if h == 1:
  print(1)
else:
  print(h*w//2) 

Fixed code:
h,w = map(int, input().split())
if h == 1 or w==1:
  print(1)
else:
  print((h*w+1)//2)
Buggy code:
H,W=map(int,input().split())
if H==1 or W==1:
  print(1)
else:
  print((H*W)/2)


Fixed code:
H,W = map(int,input().split())

if H==1 or W==1 :
  ans = 1
else :
  ans = H*W-H*W//2
  
print(ans)
Buggy code:
a,b = map(int,input().split())
num1 = (a//2)*(b//2)

if a == 1 :
    print(b)
else if b==1:
  	print(a)
else:
    
    # print(num1)
    p = b//2
    q = a//2
    num2 = (b - p )*(a - q)
    ans = num1+num2
    print(num1+num2)

Fixed code:
a,b = map(int,input().split())
num1 = (a//2)*(b//2)

if a == 1 or b==1:
    print(1)
else:
    
    # print(num1)
    p = b//2
    q = a//2
    num2 = (b - p )*(a - q)
    ans = num1+num2
    print(num1+num2)
Buggy code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 & w == 1):
  print(1)
elif(h == 1):
  print(w_b if w_a == 0 else w_b + 1)
elif(w_b == 1):
  print(h_b if h_a == 0 else h_b + 1)
elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Fixed code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 or w == 1):
  print(1)

elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)
Buggy code:
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) // 2 + 1
print (ans)

Fixed code:
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) // 2 + 1
print (ans)
Buggy code:
M, N = map(int,input().split())

if M*N % 2 == 1:
  print(M*N // 2 + 1)
elif M*N % 2 == 0:
  print(M*N // 2)
else M == 1 or N == 1:
  print(0)

Fixed code:
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)
Buggy code:
H, W = map(int, input().split())
if (H % 2 == 0 or W % 2 == 0):
  ans = H / 2
  ans = ans * W
else:
  ans = H // 2
  ans = ans * W + 1
print(int(ans))

Fixed code:
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)