Problem:


Score : 200 points

Problem Statement

We have a board with H horizontal rows and W vertical columns of squares.
There is a bishop at the top-left square on this board.
How many squares can this bishop reach by zero or more movements?

Here the bishop can only move diagonally.
More formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:

r_1 + c_1 = r_2 + c_2

r_1 - c_1 = r_2 - c_2

For example, in the following figure, the bishop can move to any of the red squares in one move:

Constraints

1 \leq H, W \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H \ W

Output

Print the number of squares the bishop can reach.

Sample Input 1

4 5

Sample Output 1

10

The bishop can reach the cyan squares in the following figure:

Sample Input 2

7 3

Sample Output 2

11

The bishop can reach the cyan squares in the following figure:

Sample Input 3

1000000000 1000000000

Sample Output 3

500000000000000000



Sample input:
4 5


Sample output:
10

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import math

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

if h%2==0:
    ans=(int)(h/2*(math.ceil(w/2)+math.ceil((w-1)/2)))
else:
    ans=(int)((h-1)/2*(math.ceil(w/2)+math.ceil((w-1)/2))+math.ceil(w/2))

print(ans)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
print((H*W)//2+(H*W)%2)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
print(H*W//2+H*W%2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
if H < W:
  H, W = W, H
print(math.ceil(H/2*W))

Submission status: Wrong Answer

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

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

else:
    ans = H//2 * W

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
h, w = map(int,sys.stdin.readline().split())
if h % 2 != 0:
  if w % 2 != 0:
    print(h * w // 2 + 1)
  else:
    print(h * w // 2)
else:
  print(h * w // 2)

Submission status: Wrong Answer

Solution code:
import sys
h, w = map(int,sys.stdin.readline().split())
if h % 2 != 0:
  if w % 2 != 0:
    print(h * w // 2 + 1)
else:
  print(h * w // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N, M = list(map(int, input().split()))
a = ((N + 1) // 2) * ((M + 1) // 2)
b = (N // 2) * (M // 2)
ans = a + b
print(ans)

Submission status: Wrong Answer

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

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

print(count)

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = map(int, input().split())
    print(1) if H == W == 1 else print((H * W + 1) // 2)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    H, W = map(int, input().split())
    print(math.ceil(H * W / 2))


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
ans = H*W

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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
ans = H*W

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution 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)
elif M == 1 or N == 1:
  print(1)

Submission status: Wrong Answer

Solution 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)
elif M == 1 or N == 1:
  print(0)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    h,w=map(int,input().split())
    if h*w%2==0:print(h*w//2)
    else:print((h*w+1)//2)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    h,w=map(int,input().split())
    if w%2:
        if h%2==0:
            print(((w+1)//2+w//2)*(h//2))
        else:
            print(((w+1)//2+w//2)*(h//2)+(w+1)//2)
    else:
        print((w//2)*h)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    h,w=map(int,input().split())
    if w%2:
        if h%2==0:
            print(((w+1)//2+w//2)*(h//2))
        else:
            print(((w+1)//2+w//2)*(h//2)+(w+1)//2)
    else:
        print(w//2*h)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

if h * w == 1:
    print(1)
    quit()
print(math.ceil(h * w /2))

Submission status: Wrong Answer

Solution code:
import math

h, w = map(int, input().split())
print(math.ceil(h * w /2))

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())

if h==1 or w==1:
    print(1)
else:
    print(math.floor(h*w/2))

Submission status: Wrong Answer

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

ans = h*(w//2)

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

Submission status: Wrong Answer

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

if h*w%2==0:
    ans = h*w/2
else:
    ans = h*w/2 + 1

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

answer = 0
answer += (((H+1)//2)*((W+1)//2) + ((H//2)*(W//2)))

print(answer)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
if h%2==0:
  print(w*h//2)
else:
  print(w*(h-1)//2-(-w//2))

Submission status: Wrong Answer

Solution code:
h, v = list(map(int, input().split())) 

print((int(h/2)+1)*(int(v/2)+1))

Submission status: Wrong Answer

Solution code:
import math
h, v = list(map(int, input().split()))

print(math.ceil(h/2)*math.ceil(v/2))

Submission status: Wrong Answer

Solution code:
import math
h, v = list(map(int, input().split()))

if h==3:
  if v==3:
    print(int(h/2)*int(v/2))
  else:
    print(int(h/2)*math.ceil(v/2))
else:
  if v==3:
    print(int(v/2)*math.ceil(h/2))
  else:
    print(math.ceil(v/2)*math.ceil(h/2))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
if H %2 != 0 and W%2 != 0:
    print(H*W//2 + 1) 
else:
    print(H*W//2)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split()) 
print(H*W//2 + 1) if H %2 != 0 and W%2 != 0 else print(H*W//2)

Submission status: Wrong Answer

Solution code:
m, n = map(int, input().split())

ans = -1

mn = m*n
if mn%2 == 0:
    ans = int(mn/2)
else:
    ans = int(mn/2) + 1
print(ans)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
if w % 2 == 0:
  c = w // 2
  d = w - c
else:
  c = (w // 2) + 1
  d = w - c
if h % 2 == 0:
  ans = w * (h//2)
else:
  ans = w * (h//2) + c
print(ans)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
if w % 2 == 0:
  c = w // 2
  d = w - c
else:
  c = w // 2 + 1
  d = w - c
if h % 2 == 0:
  ans = (c+d) * (h//2)
else:
  ans = (c+d) * (h//2) + c
print(ans)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
if w % 2 == 0:
  c = w // 2
  d = w - c
else:
  c = w // 2 + 1
  d = w - c
if h % 2 == 0:
  ans = (c+d) * (h//2)
else:
  ans = (c+d) * (h//2) + c
print(ans)

Submission status: Wrong Answer

Solution code:
#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)

Submission status: Wrong Answer

Solution code:
h,m = map(int,input().split())

if m%2 == 0:
    yoko = m//2
    print(h*yoko)
elif m%2 == 1:
    yoko_odd = m//2+1
    yoko_even = yoko_odd - 1
    if h%2 == 0:
        print(yoko_odd*h//2+yoko_even*h//2)
    elif h%2 == 1:
        print(yoko_odd*(h//2+1)+yoko_even*(h//2))

Submission status: Wrong Answer

Solution code:
import math
field = [int(i) for i in input().split(" ")]
field_num = field[0] * field[1]
canFillBlock = 0
canFillBlock += math.ceil(field[1]/2) * math.ceil(field[0]/2)
canFillBlock += math.floor(field[1]/2) * math.floor(field[0]/2)
print(canFillBlock)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
H, W=map(int,input().split())

d=H*W

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

Submission status: Wrong Answer

Solution code:
height,width = map(int,input().split())

if height%2==0:
  h1=height//2
  h2=height//2
else:
  h1 = height//2 +1
  h2 = height//2

ans = (h1+h2)*(width//2) + h1*(width%2)
print(ans)

Submission status: Wrong Answer

Solution code:
height,width = map(int,input().split())

if height%2==0:
  h1 = h2 = height//2
else:
  h1 = height //2 +1
  h2 = h1 -1

ans = h1*(width//2) + h2*(width//2) + h1*(width%2)

print(ans)

Submission status: Wrong Answer

Solution code:
height,width = map(int,input().split())

s = height * width
div = s//2

if s%2==0:
  ans = div
else:
  ans = div+1

print(ans)

Submission status: Wrong Answer

Solution code:
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()

Submission status: Wrong Answer

Solution code:
def is_odd(x):
    if x % 2 == 1:
        return True
    else:
        return False

def main():
    H, W = map(int, input().split())
    if is_odd(H) and is_odd(W):
        print(H * W // 2 + 1)
    else:
        print(H * W // 2)
main()

Submission status: Wrong Answer

Solution code:
def main():
    H, W = map(int, input().split())
    print(H * W // 2)
main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().strip().split())
pattern1 = (w + 1) // 2
pattern2 = w // 2

ans = pattern1 * ((h + 1) // 2) + pattern2 * (h // 2)

print(ans)

Submission status: Wrong Answer

Solution code:

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


print(int((H - (H % 2)) / 2 * W  + int(W / 2) * ( H % 2 ) + ( H % 2)*(W % 2)))

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    H, W = map(int, input().split())
    x1 = H // 2
    x0 = H - x1
    y1 = W // 2
    y0 = W - y1
    print(x1*y1+x0*y0)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = list(map(int, input().split()))
print( (h*w) // 2 + (h*w) % 2)

Submission status: Wrong Answer

Solution code:
h, w = list(map(int, input().split()))
print( h*w // 2 + h*w % 2)

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
print((h*w+1)//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, w=map(int, input().split())
if n%2==1 and w%2==1:
    print((n*w)//2 +1)
else:
    print(n*w//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, 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)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
print(a*b//2+a*b%2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
h, w = map(int, input().split())

if (w % 2 == 0) or (h % 2 == 0):
    ans = h*w//2
else:
    ans = math.ceil(h*w/2)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
h, w = map(int, input().split())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
h,w = map(int, input().split())
if h == 1 or w == 1:
  print(0)
else:
  print((h*w+1) // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#%%
ho = H // 2 + H % 2
he = H // 2
wo = W - (W // 2)
we = W // 2
ans = ho * wo + he * we
print(ans)

Submission status: Wrong Answer

Solution 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

Submission status: Wrong Answer

Solution code:
import math
H,W=[int(s) for s in input().split(" ")]

print(math.ceil(H*W/2))

Submission status: Wrong Answer

Solution code:
H,W=[int(s) for s in input().split(" ")]

print(int(H*W/2))

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())
if h %2 == 0 or w %2 ==0:
    print(int(h*w//2))
else:
    print(int(math.ceil(h*w/2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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)

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
print((h+w+1)//2)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
odd = ((W + 1) // 2) * ((H + 1) // 2)
even = (W // 2) * (H // 2)
print(odd + even)

Submission status: Wrong Answer

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

print((W + 1) // 2 * (H + 1) // 2 + W // 2 * H // 2)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
print ((a*b)//2+(a*b)%2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

if H == 1:
    print(W//2)
    exit()

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(0)
else:
    if W % 2 == 0:
        r = W // 2
        print(r * H)
    else:
        r1 = W // 2 + 1
        r2 = W // 2 
        c = 0
        for i in range(H):
            if i % 2 == 0:
                c += r1
            else:
                c += r2
        print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H,W = list(map(int,input().split()))
ans = 0
p = math.ceil(W/2)
for i in range(H):
    if i % 2 == 0:
        ans += p - 1
    else:
        ans += p
print(ans)

Submission status: Wrong Answer

Solution code:
import math
H,W = (int(x) for x in input().split())
print(math.ceil(H*W/2))

Submission status: Wrong Answer

Solution code:
h, w = [int(x) for x in input().split()]

print(sum(divmod(h * w, 2)))

Submission status: Wrong Answer

Solution code:
a, b = [int(i) for i in input().split()]
if a*b%2:
  c = a*b
else:
  c = a*b+1
print(c)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

count = 0
if y % 2 == 0:
	count = x * (y // 2)
elif y == 1:
	count = 1
else:
	count = x * ((y + 1) // 2) - (x // 2)

print(count)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())

count = 0
if y % 2 == 0:
	count = x * (y // 2)
else:
	count = x * ((y + 1) // 2) - (x // 2)

print(count)

Submission status: Wrong Answer

Solution code:
from math import floor, ceil
v, h = list(map(int, input().split()))
vc = ceil(v/2)
vf = floor(v/2)
hc = ceil(h/2)
hf = floor(h/2)
print(vc*hc+vf*hf)

Submission status: Wrong Answer

Solution code:
h,w = map(int, input().split())
if h%2==0:
  print(int(h*w/2))
else:
  if w%2==0:
    print(int(h*w/2))
  else:
    hh = int((h+1)/2)
    x = int((w-1)/2)
    print(int(h*x+hh))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
x=n*m+1
print(x//2)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
H, W = list(map(int, input().split()))

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

Submission status: Wrong Answer

Solution code:
H,W = [int(i) for i in input().split()]

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

Submission status: Wrong Answer

Solution code:
H,W = [int(i) for i in input().split()]

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

Submission status: Wrong Answer

Solution code:
H,W = [int(i) for i in input().split()]

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
ans = (h*w)/2
if h==1 or w==1:print(1)
else:print(round(ans))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
if h==1 and w==1:print(1)
else:print((h*w)//2)

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
print(0 if H==M==1 else (H*M+1)//2)

Submission status: Wrong Answer

Solution code:
import math
h,w=map(int,input().split())
print(math.ceil((h*w)/2))

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
print((H*M+1)//2)

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
print(H*M/2 if H*M%2==0 else (H*M/2)//1+1)

Submission status: Wrong Answer

Solution code:
from math import *
h, w = map(int, input('').split(' '))

print(ceil(w/2) * ceil(h/2) + floor(w/2) * floor(h/2) )

Submission status: Wrong Answer

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

if H % 2==0 and W % 2 ==0 :
    ans = (H*W)/2
elif H % 2==0 and W % 2 ==1 :
    ans = (H*W)/2
elif H % 2==1 and W % 2 ==0 :
    ans = (H*W)/2
elif H % 2==1 and W % 2 ==1 :
    ans = (H*W)/2 + 1
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
arr1=list(map(int,input().strip().split()))[:2]
r,c=arr1[0],arr1[1]
list1=[0 for i in range(c)for j in range(r)]
count=0
for i in range(r):
    for j in range(c):
        if(i+j % 2==0):
            count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import math
arr1=list(map(int,input().strip().split()))[:2]
r,c=arr1[0],arr1[1]
print(math.ceil(r/2)*math.ceil(c/2)+(r-math.ceil(r/2))*(c-math.ceil(c/2)))

Submission status: Wrong Answer

Solution code:
import math
arr1=list(map(int,input().strip().split()))[:2]
r,c=arr1[0],arr1[1]
print(math.ceil(r/2)*math.ceil(c/2)+math.floor(r/2)*math.floor(c/2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

board = h * w

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

Submission status: Wrong Answer

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

board = h * w

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
print(-(-H*W//2))

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
print(((w+1)//2)*((h+1)//2)+(w//2)*(h//2))

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
print((w+1)//2*(h+1)//2+(w//2)*(h//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
 
l = [int(x) for x in input().split()]
 
print(math.ceil((l[0]*l[1])/2))

Submission status: Wrong Answer

Solution code:
import math
 
l = [int(x) for x in input().split()]
 
print(math.ceil(l[0]*l[1]))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
print(h*w-h*w//2)

Submission status: Wrong Answer

Solution code:
h, w = map(int,input().split())
print(h*w/2 if h*w/2==0 else int((h*w-1)/2+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
HW = list(map(int,input().split()))
if all(x%2==1 for x in HW):
    print(int((HW[0]*HW[1]+1)/2))
else:
    print(int((HW[0]*HW[1])/2))

Submission status: Wrong Answer

Solution code:
import sys
import math
input = sys.stdin.readline

h, w = map(int, input().split())
ans = math.ceil(w / 2) * math.ceil(h / 2) + math.floor(w / 2) * math.floor(h / 2)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
result=0
if H==1 or W==1:
    print("1")
elif W%2==0:
    result = (W/2)*H
else:
    if H%2==0:
        result=W*(H/2)
    else :
        result=W*(H-1)/2+(W+1)/2
print(str(round(result)))

Submission status: Wrong Answer

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

print(-(-H*W//2))

Submission status: Wrong Answer

Solution code:
import math
h, w = [int(i) for i in input().split(" ")]

print(math.ceil(h*w/2))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

if a % 2 == 0:
    print(a*b//2)
else :
    if b % 2 == 0:
        print(a*b//2)
    else :
        a = a+1
        b = b+1
        print((a//2*b//2) + ((a//2)-1)*((b//2)-1))

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())
print(math.ceil(h*w/2))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
a = (h+1)//2
b = (w+1)//2
print(a*b+(h-a)*(w-b))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
print(-(-h*w//2))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
print(h*w//2)