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

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

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

Submission status: Wrong Answer

Solution code:
s = input().split()
W = int(s[0])
H = int(s[1])

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

print(int(out))

Submission status: Wrong Answer

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

if w % 2 == 0:
    ans = (w // 2) * h
else:
    ans = (w // 2) * h + (ceil(h / 2))
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:
import math

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

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

Submission status: Wrong Answer

Solution code:
s = input().split()
W = int(s[0])
H = int(s[1])

# N = 6
# A = 2
k=0
if W % 2 == 0:
    out = (H * W) / 2
else:
    if W % 2 == 0:
        k = int(H / 2)
    else:
        k = int(H / 2)+1
    out = int((H * (W - 1)) / 2) + k

print(int(out))

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    H, W = [int(_) for _ in input().split()]
    if H % 2 == 1 and W % 2 == 1:
        m = (H * W) // 2 + 1
    elif H == 1 or W == 1:
        m = 1
    else:
        m = (H * W) // 2
    print(int(m))
main()

Submission status: Wrong Answer

Solution code:
from math import ceil
a,b=map(int,input().split())
if a%2 and b%2:
    print(a*b//2+1)
else:
    print(a*b//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

from math import ceil, sqrt, floor

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

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)

Submission status: Wrong Answer

Solution code:
import math

def main():
    H, W = [int(_) for _ in input().split()]
    if H % 2 == 0 or W % 2 == 0:
        m = (H * W) /2
    elif H == 1 or W == 1:
        m = 1
    else:
        m = (H * W) /2
        m = math.ceil(m)
    print(int(m))
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a%2 and b%2:
    print(a*b//2+1)
else:
    print(a*b//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:
# 各条件の入力
dummy_input = None
if dummy_input:
    H,W = map(int, dummy_input.split())
else:
    H,W = map(int, input().split())

# 答えの出力

def is_odd(num):
    return num % 2 ==1

if is_odd(H) and is_odd(W):
    ans = ((H * W) + 1)/2
elif is_odd(H):
    ans = ((H+1) * W) - (H+1)/2
elif is_odd(W):
    ans = (H * (W+1)) - (W+1)/2
else:
    ans = (H*W) / 2

# 出力
print(int(ans))

Submission status: Wrong Answer

Solution code:
from math import ceil
n,m=map(int,input().split())
if n==1 or m==1:
  print(1)
else:
    print(ceil(n/2)*ceil(m/2)+n//2*m//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
arg = input().split(' ')
H = int(arg[0])
W = int(arg[1])

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

w_odd = (W+1) // 2
w_even = W // 2

h_odd_line = (H+1) // 2
h_even_line = H // 2

reachable = w_odd * h_odd_line + w_even * h_even_line
print(reachable)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#B - Bishop
import math
H,W= map(int, input().split())
if H == 0 or W == 0:
  print(1)
else:
  print(int(math.ceil(H/2) * math.ceil(W/2) + math.floor(H/2)*math.floor(W/2)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

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

if w ==1:
    print(1)

# (偶数、偶数) (奇数、偶数)の場合
if (h%2 == 0 and w%2 ==0) or (h%2 != 0 and w%2 == 0):
    ans = int(w/2) * h

# 奇数、奇数の場合
elif h%2 != 0 and w%2 !=0:
    f = int(w/2) + 1
    s = f-1
    ans = f * (int(h/2)+1) + s * int(h/2)

# 偶数、奇数の場合
elif h%2 == 0 and w%2 != 0:
    f = int(w/2) + 1
    s = int(w/2)
    ans = f * int(h/2) + s * int(h/2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# (偶数、偶数) (奇数、偶数)の場合
if (h%2 == 0 and w%2 ==0) or (h%2 != 0 and w%2 == 0):
    ans = int(w/2) * h

# 奇数、奇数の場合
elif h%2 != 0 and w%2 !=0:
    f = int(w/2) + 1
    s = f-1
    ans = f * (int(h/2)+1) + s * int(h/2)

# 偶数、奇数の場合
elif h%2 == 0 and w%2 != 0:
    f = int(w/2) + 1
    s = int(w/2)
    ans = f * int(h/2) + s * int(h/2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
if a!=1 or b!=1:
  print(math.ceil(a*b/2))
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = list(map(int,input().split()))
h=inp[0]
w=inp[1]
k=(w-w//2)*(h-h//2)+(w//2)*(h//2)
print (k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a,b=map(int,input().split())
if a!=1 or b!=1:
  print(math.ceil(a*b/2))
else:
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    input_line = 1
    for i in range(input_line):
        s = input().rstrip().split(' ')
        H = int(s[0])
        W = int(s[1])
        print(int(H*W/2) if (H%2==0 or W%2 == 0) else int(H*W/2)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from math import floor

N = [int(_) for _ in input().split()]

H, W = N[0], N[1]


def solve(H, W):
    acnt = floor(W / 2) + 1
    bcnt = W - acnt
    
    if H == 1 or W == 1:
        return 1
    
    if H % 2 == 0:
        cnt = acnt * floor(H/2) + bcnt * floor(H/2)
    else:
        cnt = acnt * (floor(H/2) + 1) + bcnt * floor(H/2)
    return cnt

print(solve(H, W))

Submission status: Wrong Answer

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

if W % 2 == 0:
    print((H * W) // 2)
elif H == 1 or W == 1:
    print(1)
else :
    odd_row = (W // 2) + 1
    even_row = W // 2
    if H % 2 == 1:
        odd_row_num = (H // 2) + 1
        even_row_num = H // 2
        print((odd_row*odd_row_num) + (even_row*even_row_num))
    else :
        print((odd_row+even_row) * (H // 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = list(map(int,input().split()))
h=inp[0]
w=inp[1]
print(h*w-(h//2)*w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


h = 0
w = 0
w1 = w2 = 0

if W % 2 == 1:#横が奇数
    w = int(W /2) + 1
    if H % 2 == 1:#縦が奇数
        h = int(H / 2) + 1
        w1 = h * w
        w2 = (w-1) * (h-1)
        print(w1 + w2)
    else:#縦が偶数
        h = int(H / 2)
        w1 = w * h
        w2 = (w-1) * h
        print(w1 + w2)


else:#横が偶数
    w = int(W / 2)
    print(w * H)

Submission status: Wrong Answer

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

#縦hマス横wマス
hantei = h % 2
hantei_2 = w % 2

#縦が偶数の時
if hantei == 0:
    h = math.floor(h)
    result = (sum - (h / 2) * w)
    print(math.floor(result))
#縦が奇数の時
else:
    #横が偶数の時
    if hantei_2 == 0:
        h = h + 1 
        print(math.floor(sum - h * 2))
    #横が奇数の場合
    else:
        w = w /2 
        w = math.floor(w)
        kake =  w + 1
        h = h /2 
        h = math.floor(h)
        result = sum - ((kake * h) +  ((kake -1 ) *(h + 1)))
        print(math.floor(result))

Submission status: Wrong Answer

Solution code:
from math import floor

N = [int(_) for _ in input().split()]

H, W = N[0], N[1]


def solve(H, W):
    
    if H == 1 or W == 1:
        return 1
    
    cnt = int(H * W / 2)
    return cnt

print(solve(H, W))

Submission status: Wrong Answer

Solution code:
inp = list(map(int,input().split()))
h=inp[0]
w=inp[1]
print((h//2)*w)

Submission status: Wrong Answer

Solution code:
import math


n= list(map(int, input().split()))

if n[0] % 2 == 0:
  print(math.ceil(n[0] / 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
  
elif n[0] == 1 or n[1] == 1:
    print('1')
else:
  result = math.ceil(n[0] / 2) * math.ceil(n[1] / 2) + math.floor(n[0] / 2) *math.floor(n[1] / 2)
  print(result)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
H, W = [int(str) for str in input().strip().split()]

print((H * W + 1) // 2 if H != 0 and W != 0 else 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,(input().split()))
sum = h * w
h = math.floor(h)
w = math.floor(w)
#縦hマス横wマス
hantei = h % 2
hantei_2 = w % 2

#縦が偶数の時
if hantei == 0:
    h = math.floor(h)
    result = (sum - (h / 2) * w)
    print(math.floor(result))
#縦が奇数の時
else:
    #横が偶数の時
    if hantei_2 == 0:
        h = h + 1 
        print(math.floor(sum - h * 2))
    #横が奇数の場合
    else:
        w = w /2 
        w = math.floor(w)
        kake =  w + 1
        h = h /2 
        h = math.floor(h)
        result = sum - ((kake * h) +  ((kake -1 ) *(h + 1)))
        print(math.floor(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-


def count(H, W):
    if H % 2 == 0:
        return int(int(H / 2) * W)
    elif W % 2 == 0:
        return int(H * int(W / 2))
    else:
        return int(int(H / 2) * W + int(W / 2) + 1)


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

if w % 2 == 0:
	cx0 = int(w/2)
	cx1 = cx0
else:
	cx0 = int(w/2) + 1
	cx1 = int(w/2)

if h % 2 == 0:
	print(int(h / 2) * (cx0 + cx1))
else:
	print(int(h / 2) * (cx0 + cx1) + cx0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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 += a * (W // 2)
ans += b * (W - (W // 2))

print(ans)

Submission status: Wrong Answer

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-


def count(H, W):
    if H % 2 == 0 or W % 2 == 0:
        return int(H * int(W / 2))
    else:
        return int(int(H / 2) * W + int(W / 2) + 1)


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def main():
    H,W = list(map(int, input().split(' ')))
    if(H == 1 or W ==1):
      print(1)
    print(math.ceil((W*H)/2))
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(a1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
a=0
b=0
c=0

if h%2==0 and w%2==0:
    a=h/2
    b=h/2
elif h%2==0 and w%2==1:
    b=int(h/2)+1
    a=h/2
elif h%2==1 and w%2==0:
    a=int(h/2)+1
    b=h/2
else:
    a=int(h/2)+1
    b=int(h/2)+1

for j in range(w):
        if j%2==1:
            c=c+a
        else:
            c=c+b
print(c)

Submission status: Wrong Answer

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

c=0

if h%2==0 and w%2==0:
    a=h/2
    b=h/2
elif h%2==0 and w%2==1:
    b=int(h/2)+1
    a=h/2
elif h%2==1 and w%2==0:
    a=int(h/2)+1
    b=h/2
else:
    a=int(h/2)+1
    b=int(h/2)+1

for j in range(w):
        if j%2==1:
            c=c+a
        else:
            c=c+b
print(c)

Submission status: Wrong Answer

Solution code:
import math


n= list(map(int, input().split()))

if n[0] % 2 == 0:
  print(math.ceil(n[0] / 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
else:
  result = math.ceil(n[0] / 2) * math.ceil(n[1] / 2) + math.floor(n[0] / 2) *math.floor(n[1] / 2)
  print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if w%2==0:
    print((w//2)*h)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def b():
    # h, w = map(int,input().split())
    h,w= 3,100
    ki = int(h/2) + h%2
    gu = int(h/2)

    sum_ki = ki *(int(w/2) + w%2)
    sum_gu = gu * (int(w / 2) )
    print(sum_ki+sum_gu)

# def c():
#     a, b,c = map(int, input().split())
#     ab = 4*a*b
#     a_b_c = (c-(a+b))
#     a_b_c_2 = a_b_c**2
#     if a_b_c <=0:
#         print("No")
#     else:
#         if ab < a_b_c_2:
#             print("Yes")
#         else:
#             print("No")



if __name__ == '__main__':
    b()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

  print(int(ans))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if w % 2 == 1:

	for i in range(1, h+1):
		if i % 2 ==1:
			c += (w // 2) + 1
		if i % 2 == 0:
			c += (w // 2)  

else:
	for i in range(1, h+1):
		if i % 2 ==1:
			c += (w // 2)
		if i % 2 == 0:
			c += (w // 2) -1

print(c)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

H, W = read_int()

def solve():
    if H == 1:
        return W
    elif W == 1:
        return H
    else:
        return W * H // 2 + W * H % 2

if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
def countSquares(row, column): 
    topLeft = min(row, column) - 1
    bottomRight = 8 - max(row, column) 
    topRight = min(row, 9-column) -1
    bottomLeft = 8 - max(row, 9-column)  
    return (topLeft + topRight + bottomRight + bottomLeft) 
res = 0
H,W = map(int,input().split())
Q = min(H,W)
for i in range(Q):
	  res += countSquares(i, i)
if res % 2 == 0:
  print(res//2)
else:
  print(res//2 + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:08:49 2020

@author: H_Hoshigi
"""

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    h,w = map(int, input().split())
    
    print(max(ceil(h/2) * ceil(w/2) + floor(w/2)*floor(h/2), h*w//2+1))
        

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-


def count(H, W):
    if H % 2 == 0 or W % 2 == 0:
        return int(H * int(W / 2))
    else:
        return int(H * W / 2 + 1)


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_UP

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a%2 and b%2:
  print(0)
else:
  print(a*b//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:
s = input()
(h, w) = [int(str) for str in s.split()]

answer = (h * w + 1) / 2
print ("%d" % answer)

Submission status: Wrong Answer

Solution code:
h,w = (int(x) for x in 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 = list(map(int, input().split()))
 
 
w, h = list(map(int, input().split()))
 
if(((w%2)*(h%2))%2==0):
    print(int(w*h//2+0))
else:
    print(int(w*h//2+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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