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

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

Submission status: Wrong Answer

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

ans = H*W//2
if ans%2 == 1:
    ans += 1
print(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+1)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
hd, hm, wd, wm = h // 2, h % 2, w // 2, w % 2
s = hd * wd * 2  + hm * wd + wm * hd + hm * wm
print(s)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
hd, hm, wd, wm = h // 2, h % 2, w // 2, w % 2
s = hd * wd * 2  + hm * wd + wm * hd + hm * wm
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 % 2 == 0:
    print( H // 2 * W )
else:
    print( ( H - 1 ) // 2 * W + math.ceil( W / 2) )

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A = list(map(int, input().split()))
H = A[0]
W = A[1]

first = math.ceil(H/2)
second = math.floor(H/2)
if H>= 2:
  ans = math.ceil(W/2)*first + math.floor(W/2)*second
elif H==1:
  ans = 1
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math
A = list(map(int, input().split()))
H = A[0]
W = A[1]

first = math.ceil(H/2)
second = math.floor(H/2)
if H>= 2 and W>=2:
  ans = math.ceil(W/2)*first + math.floor(W/2)*second
elif H>= 2 and W==1:
  ans = first
elif H==1:
  ans = 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
A = list(map(int, input().split()))
H = A[0]
W = A[1]

first = math.ceil(H/2)
second = math.floor(H/2)
ans = math.ceil(W/2)*first + math.floor(W/2)*second 
print(ans)

Submission status: Wrong Answer

Solution code:
def bishop(n, m):
	if n % 2 == 0:
		return (n // 2) * m
	else:
		return (((n // 2)+1) * m) - (m // 2)
n, m = map(int, input().split())
print(bishop(n, m))

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    row1 = [int(x) for x in input().rstrip().split(" ")]
    h = row1[0]
    w = row1[1]

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

    ans = (h-(h%2))*(w-(w%2))/2
    ans += (h%2)*(w-(w%2))/2
    ans += (w%2)*(h-(h%2))/2
    ans += (w%2)*(h%2)

    print(int(ans))


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    row1 = [int(x) for x in input().rstrip().split(" ")]
    h = row1[0]
    w = row1[1]

    print( int(((h-(h%2))) * (w-(w%2))/2 + (h%2)*(w-(w%2))/2 + (w%2)*(h-(h%2))/2 + (w%2)*(h%2)))


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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+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:
#B - Bishop △(TLE,WA)
H,W = map(int,input().split())

count = 0
if H == 1 or W == 1:#コーナーケース(H,Wが1の時どこにも動けない)
    print(1)
if H % 2 == 0:
    count = (H // 2)*W
else :
    count = (H // 2)*W + ((W + 2 - 1) // 2)#x/yの切り上げ:(x+y-1)//y
print(count)

Submission status: Wrong Answer

Solution code:
#B - Bishop △(TLE)
H,W = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
#B - Bishop
H,W = map(int,input().split())

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

Submission status: Wrong Answer

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

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

H_ = H % 2
W_ = W % 2
if H_ == 0:
    print(str(round(H/2*W//1)))

elif H_ == 1:
    h = H // 2 + 1
    h_ = H // 2
    if W_ == 0:
        print(str(round((h + h_)*W/2)))

    elif W_ == 1:
        w = W // 2+1
        w_ = W // 2
        print(str(round(h * w + h_ * w_)))

Submission status: Wrong Answer

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

H_ = H % 2
W_ = W % 2
if H_ == 0:
    print(str(round(H/2*W//1)))

elif H_ == 1:
    h = H // 2 + 1
    h_ = H // 2
    if W_ == 0:
        print(str(round((h + h_)*W/2)))

    elif W_ == 1:
        w = W // 2+1
        w_ = W // 2
        print(str(round(h * w + h_ * w_)))

Submission status: Wrong Answer

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

H_ = H % 2
W_ = W % 2
if H_ == 0:
    print(round(H/2*W//1))

else:
    h = H // 2 + 1
    h_ = H // 2
    if W_ == 0:
        print(round((h + h_)*W/2))

    elif W_ == 1:
        w = W // 2+1
        w_ = W // 2
        print(round(h * w + h_ * w_))

Submission status: Wrong Answer

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

H_ = H % 2
W_ = W % 2
if H_ == 0:
    print(H/2*W//1)

else:
    h = H // 2 + 1
    h_ = H // 2
    if W_ == 0:
        print((h + h_)*W/2//1)

    elif W_ == 1:
        w = W // 2+1
        w_ = W // 2
        print((h * w + h_ * w_)//1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

print(int(np.ceil((H * W) / 2)))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

if H % 2 == 0:
    print((H // 2) * W)
else:
    print(int(np.ceil((H * W) / 2)))

Submission status: Wrong Answer

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

print((H // 2) * W)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
import math

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

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

Submission status: Wrong Answer

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

if w % 2 == 0:
  x = w // 2
else:
  x = (w + 1) // 2
  
if h % 2 == 0:
  y = h // 2
else:
  y = (h + 1) // 2

if w % 2 == 0:
  ans = x * y + x * (h - y)
else:
  ans = x * y + (x - 1) * (h - y)
  
print(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())
c = 0
T = (W+1)//2
S = W//2

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

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 and W == 1:
    print(1)
elif H % 2 == 0 or W % 2 == 0:
    print(H * W // 2)
else:
    h = max(H, W)
    w = min(H, W)
    print((h-1) * w // 2 + math.ceil(w / 2))

Submission status: Wrong Answer

Solution code:
import math

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

if H == 1 and W == 1:
    print(1)
elif H % 2 == 0 or W % 2 == 0:
    print(H * W // 2)
else:
    print((max(H, W) - 1) * min(H, W) // 2 + math.ceil(min(H, W) / 2))

Submission status: Wrong Answer

Solution code:
import math

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

if H == 1 and W == 1:
    print(1)
elif H % 2 == 0 or W % 2 == 0:
    print(H * W // 2)
else:
    print((H - 1) * W // 2 + math.ceil(W / 2))

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
H,W = [int(n) for n in input().split()]
print((H*W//2) if H*W%2==0 else ((H*W+1)//2))

Submission status: Wrong Answer

Solution code:
H,W = [int(n) for n in input().split()]
print((H*W//2) if H*W//2==0 else ((H*W+1)//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b = map(int,input().split())
n = a*b
if n % 2 == 0:
    print(n // 2)
    exit()
    
else:
    print((n + 1) // 2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())
div,mod = divmod(H*W,2)
print(div+mod)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
if H%2==0 or W%2==0:
    print(H*W//2)
elif H==1 or W==1:
    print(1)
else:
    a=int(H*W/2)
    print(a+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:
    a=int(H*W/2)
    print(a+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:
def main():
    H, W = map(int ,input().split())
    L1 = 0
    L2 = 0

    L1 = L2 = W // 2

    if W % 2 == 1:
        L1 += 1

    ans = (L1 + L2) * (H//2)

    if H % 2 == 1:
        ans += L1

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    L1 = L2 = W // 2

    if W % 2 == 1:
        L1 += 1

    ans = (L1 + L2) * (H//2)

    if H % 2 == 1:
        ans += L1

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h % 2 == 0 or w % 2 == 0:
    print((h * w )//2)
elif h == 1 or w == 1:
    print(1)
else:
    print( h * ( (w-1) // 2 )  + ( (h-1) // 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)
elif h == 1 or w == 1:
    print(1)
else:
    print(h*(w//2) + h // 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) + h // 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())
total = H*W
if total % 2 == 0:
    ans = total//2
else:
    total += 1
    ans = total//2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for _ in range(M)]

H,W=map(int, input().split())
print(ceil(H/2)*ceil(W/2) + floor(H/2)*floor(W/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

res = int((H*W)/2)
print(res)

Submission status: Wrong Answer

Solution code:
import math

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

if H == 1 and W == 1:
  print(0)
  exit()

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

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

num_of_even = int(H / 2)
num_of_odd = H - num_of_even

count = 0

count += int(W / 2) * num_of_even
count += math.ceil(W / 2) * num_of_odd

print(count)

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = h * w
if s % 2 == 0:
  print(s // 2)
  exit(0)
print(s // 2 + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
h, w = map(int, input().split())

cnt = 0

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

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

print(cnt)

Submission status: Wrong Answer

Solution code:
H, W = map(int,input().split())
import math
if H == 1 and W == 1:
    print(0)
    exit()

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

Submission status: Wrong Answer

Solution code:
H, W = map(int,input().split())
import math
if H == 1 and W == 1:
    print(0)
    exit()

if H % 2 == 0:
    print(H // 2 * W)
else:
    print(H // 2 * W + math.ceil(W / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

l = list(map(int, input().split()))
a = l[0]
b = l[1]

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

Submission status: Wrong Answer

Solution code:
import numpy as np

l = list(map(int, input().split()))
a = l[0]
b = l[1]

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

Submission status: Wrong Answer

Solution code:
n, m = [int(i) for i in input().split(" ")]
print((n*m + 1)//2)

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
print((H * W + 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,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())

ans = 0

if H%2==0:
  a = H // 2
  b = H // 2
else:
  a = H // 2 + 1
  b = H // 2

if W%2==0:
  ans = a * (W // 2) + b * (W // 2)
else:
  ans = a * (W // 2 + 1) + b * (W // 2)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

H, W = map(int, input().split())
    
ans = int(H / 2) * W
if (H % 2) == 1:
    ans += math.ceil(W / 2)

if H == 1 or W == 1:
    ans = 0

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

ans = int(H / 2) * W
if (H % 2) == 1:
    ans += math.ceil(W / 2)

print(ans)

Submission status: Wrong Answer

Solution code:
h, w = [int(i) for i in input().split()]
ha = h % 2
wa = w % 2

s = 0

s += ((h - ha) * (w - wa)) / 2

a = ha * w
a += wa * h
a -= 1 if (ha == 1 and wa == 1) else 0
s += a / 2

print(int(s))

Submission status: Wrong Answer

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

A = W//2
B = A
if W%2 == 1:
    B += 1

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

print(ans)

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 % 2 == 1 and w % 2 == 1):
  print((h*w)//2 + 1)
else:
  print(h*w // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b=list(map(int,input().split()))
print(math.ceil((a*b)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
h_odd, h_even = (h // 2) + (0 if h % 2 == 0 else 1), h // 2
w_odd, w_even = (w // 2) + (0 if w % 2 == 0 else 1), w // 2
print((h_odd * w_odd) + (h_even * w_even))

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
#print(h, w)
if h == 1 or w == 1:
  print(0)
elif 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())
#print(h, w)
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())
print(h, w)
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==1 and W==1):
    print(1)
elif (H%2==0):
    H /=2
    print(int(H*W))
else:
    H //= 2
    if(W%2==0):
        print(int(H*W+(W/2)))
    else:
        print(int(H*W+(W//2+1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (H * W) % 2:
  print(H*W // 2 + 1)
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/2+1))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def main():
    h,w = map(int, input().split())
    if h*w %2 == 0:
        print(int(h*w/2))
    else:
        print(int((h*w+1)/2))
    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    resolve()

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())
ans = h * w //2 + (h*w)%2
print(ans)

Submission status: Wrong Answer

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

if W==1:
    print(1)
else:
    print((H*W+1)//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+(H/2+1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

seki = H * W

ans = (seki + 2 - 1) // 2
print(ans)

Submission status: Wrong Answer

Solution code:
#6
H,W = map(int,input().split())
k = H*W

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

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

Submission status: Wrong Answer

Solution code:
#6
H,W = map(int,input().split())
k = H*W

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a==1 or b==1:
	print(0)
else:
	print(math.ceil(a*b/2))

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
a,b=map(int,input().split(' '))

print(math.ceil(Decimal(a)*Decimal(b)/2))

Submission status: Wrong Answer

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

print(math.ceil(a*b/2))

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

def main():

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():

    h,w = map(int, input().split())
    if h != 1 and w != 1:
        print(math.ceil(h*w/2))
    else:
        print(0)
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = H*W

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h>1 and w>1:
  print(math.ceil(h*w/2))
  
else:
  print(0)

Submission status: Wrong Answer

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

    if H % 2 == 0:
        if W % 2 == 0:
            res = H * W // 2
        else:
            res = H * W // 2
    else:
        if W % 2 == 0:
            res = H * W // 2
        else:
            res = H * W // 2 +1

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

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) % 2 == 0:
  print((h * w) // 2)
elif (h * w) % 2 == 1:
  print(((h * w) // 2) + 1)

Submission status: Wrong Answer

Solution code:
def main():
    H, W = map(int, input().split())
    B = W // 2
    A = W - B
    D = H // 2
    C = H - D
    print(C * A + D * B)
main()

Submission status: Wrong Answer

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

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