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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = (int(x) for x in input().split())

if H * W == 1:
    k = 1
elif H*W % 2 == 1:
    if (H == 1 or W == 1) and H*W != 1:
        a = list(filter(lambda x: x != 1, [H, W]))
        k = int(a[0] / 2) + 1
    else:
        k = int(H / 2) + (int(W / 2)) * H + 1
elif H * W % 2 == 0:
    k = int(H * W / 2)

print(k)

Submission status: Wrong Answer

Solution code:
i = input().split()
h = int(i[0])
w = int(i[1])

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
c = a*(b//2)

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

print(int(c))

Submission status: Wrong Answer

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

m = 0
h = a[0]
w = a[1]

'''
for hi in range(h):
    for wi in range(w):
        if hi+1 + wi+1 == 2 or hi - wi == 0 or wi - hi == 0:
            m += 1

print(m)

for hi in range(h):
    for wi in range(w):
        if (hi+1 + wi+1) % 2 == 0:
            m += 1
'''

m = math.ceil(w/2) * math.ceil(h/2) + math.floor(w/2) * math.floor(h/2)

print(m)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

h, w = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Wrong Answer

Solution code:
import sys
n = list(map(int, input().split()))

if n[0] == 1 or n[1] == 1:
    print(0)

if n[0] % 2 == 0:
    print(int((n[0]*n[1])/2))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(int((n[0]*n[1])/2))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(int(a+b))
        sys.exit()

Submission status: Wrong Answer

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

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

else:
    if(H%2 == 0):
        i = H//2
    if(H%2 != 0):
        i = H//2+1
    
    j = H-i

    if(W%2 == 0):
        sum = i*(W//2) + j*(W//2)

    if(W%2 != 0):
        sum = i*(W/2+1) + j*(W/2)
    

    print(sum)

Submission status: Wrong Answer

Solution code:

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


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

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

Submission status: Wrong Answer

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

totalsum = (W * H) // 2
totalsum += (W * H) % 2

print(totalsum)

Submission status: Wrong Answer

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

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

resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if h % 2 == 0 and w % 2 != 0:
	print(w*2)
	exit()
elif h % 2 != 0 and w % 2 == 0:
	print(h*w)
	exit()

Submission status: Wrong Answer

Solution code:
h, w = [int(s) for s in input().split()]
rh, rw = h%2, w%2
eh, ew = h - rh, w- rw

result = int( (eh//2) * ew + (rh * (ew /2 + rw)) + (rw * (eh / 2 + rh)) - (1 if rw ==rh == 1 else 0))
print(result)

Submission status: Wrong Answer

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

    print(W)
elif W==2:
    print(H)
elif H!=W:
    mas=-(-W//2)
    nextmas=mas-1
    Set=int(H/2)
    amari=H%2


    num=(mas+nextmas)*Set

    num+=mas*amari

    print(int(num))
else:
    mas=-(-W//2)
    num=mas*H
    print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S % 2 == 0:
    print(s)
elif S % 2 == 1:
    print(s+1)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
s=input().rstrip().split()
h=Decimal(s[0])
w=Decimal(s[1])
res =0
if h%2==0:
    res = (h/2) * w
else:
    if w%2==0:
        res = int(h/2) * w +  w/2  
    else:
        res = int(h/2) * w + int(w/2) + 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

mas = h*w

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
boad = h * w
if boad < 4:
  print(1)
elif boad % 2 == 1 and boad > 3:
  print(boad // 2 + 1)
elif boad % 2 == 0:
  print(boad // 2)

Submission status: Wrong Answer

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

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

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    idle = int(w / 2)
    num = idle * 2
    
if h % 2 == 1 and w % 2 == 0:
    row = int(h // 2)
    print(num + idle - 1)
elif h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)  
else:
    row = int(h / 2)
    print(num * row)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

    print(int(ans))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

totalsum = (W * H) // 2
totalsum -= (W * H) % 2

print(totalsum)

Submission status: Wrong Answer

Solution code:
import math

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

print(int((A[0]*A[1]+1)/2))

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

H_rem = int(H % 2)
H_div = int(H / 2)
W_rem = int(W % 2)
W_div = int(W / 2)


output = int(0)
if H_rem == 0:
	output = W * H_div
else:
	if W_rem == 0:
		output = W_div * H
	else:
		output = H * W_div + H_div + 1
    
print(int(output))

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
K = 0
L = 0
#条件分岐
#H = 奇数 W = 奇数
if H == 1 or W == 1:
    print(1)
elif H%2 == 1 and W%2 == 1:
    K = (H//2+1)*(W//2+1)
    L = (H//2)*(W//2)
#H = 奇数 W = 偶数
elif H%2 == 1 and W%2 == 0:
    K = (H//2+1)*(W//2)
    L = (H//2)*(W//2)
#H = 偶数 W = 奇数
elif H%2 == 0 and W%2 == 1:
    K = (H//2)*(W//2+1)
    L = (H//2)*(W//2)
else:
    K = H*(W//2)
    L = 0
print(K+L)

Submission status: Wrong Answer

Solution code:
import math
N, M = map(int, input().split())

M1 = M-M%2
ans = N*M1//2
ans += math.ceil(N/2*(M%2))
print(int(ans))

Submission status: Wrong Answer

Solution code:
HW=input().rstrip('\n').split()
H=int(HW[0])
W=int(HW[1])
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:
import numpy as np
import fractions

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

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(' '))
print(int(h * w / 2) + h * w % 2 if h > 1 and w > 1 else 0)

Submission status: Wrong Answer

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

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

print(int(ans))

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 // 2))

Submission status: Wrong Answer

Solution code:
def cal(h,w):
    if (h%2==1 and w%2 == 1):
        print((int)((h*w+1)/2))
    else:print((int)(h*w/2))

h,w= (int(x) for x in input('入力して：').split())
cal(h,w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = (int(x) for x in input().split())

k = int(H * W / 2)
if H * W == 1:
    k = 1
elif H*W % 2 == 1:
    if (H == 1 or W == 1) and H*W != 1:
        a = list(filter(lambda x: x != 1, [H, W]))
        k = int(a[0] / 2) + 1
    else:
        k = int(H / 2) + (int(W / 2)) * H + 1

print(k)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = [int(x) for x in input().split()]
ans = ((a * b) + 1) // 2
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions

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

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
if n % 2 == 0:
  ans = n * m // 2
else:
  if m % 2==0:
    ans = n * m // 2
  else:
    ans = (n * (m+1) // 2 )- n //2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

if H == 1:
  print('1')

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

Submission status: Wrong Answer

Solution code:
import sys
n = list(map(int, input().split()))

if n[0] == 1 or n[1] == 1:
    print(1)

if n[0] % 2 == 0:
    print(int((n[0]*n[1])/2))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(int((n[0]*n[1])/2))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(int(a+b))
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = input().split()
h = int(i[0])
w = int(i[1])
if h == 1 or w == 1:
 	print(1)
if h % 2 == 0:
    move_h = h / 2
    print(int(move_h * w))
else:
    move_h = h / 2
    print(int(move_h * 2) + int((h /2)+1))

Submission status: Wrong Answer

Solution code:
import math

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

print((A[0]*A[1]+1)/2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

else:
	print(int(((H+1)*W)/2-(W-1)/2))

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    h,w = mi()

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

if __name__ == "__main__":
    main()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import math

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % 2 == 0 or b % 2 == 0:
  print(a * b // 2)
  
if a % 2 == 1 and b % 2 == 1 and b > 1 :
  ans = a * (b //2) + (a + 1) //2
  print(ans)
  
if a % 2 == 1 and b == 1:
  ans1 = (a * b + 1) //2

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

inp = input()
hw = inp.split(' ')
h = int(hw[0])
w = int(hw[1])

gusu_p = math.ceil(w/2)
kisu_p = math.floor(w/2)

gusu_num = math.floor(h/2)
kisu_num = math.ceil(h/2)

ret = (gusu_p*gusu_num) + (kisu_p * kisu_num)

print('{}'.format(ret))

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
if n % 2 == 0:
  ans = n * m / 2
else:
  if m % 2==0:
    ans = n * m / 2
  else:
    ans = (n * (m+1) / 2 )- n /2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

firstInputText = input()
inputList = firstInputText.split()
h = int(inputList[0])
w = int(inputList[1])
result = math.ceil(h*w/2)

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(int(count))

Submission status: Wrong Answer

Solution code:
H_W = input()
my_list = H_W.split(" ")
H = int(my_list[0])
W = int(my_list[1])
a = H*W
if a % 2 == 0:
    print(a/2)
else:
    print((a+1)/2)

Submission status: Wrong Answer

Solution code:
R,C = list(map(int, input().split()))

if (R*C) % 2 == 0:
    print(int(R * C / 2))
else:
    print(int(R * C / 2 + 1))

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = list(map(int, input().split()))

if n[0] % 2 == 0:
    print(int((n[0]*n[1])/2))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(int((n[0]*n[1])/2))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(int(a+b))
        sys.exit()

Submission status: Wrong Answer

Solution code:
from math import ceil
a, b = [int(x) for x in input().split()]
if a >=2 and b >= 2:
	if a == 2 and b == 2:
		print(2)
	else:print( ((a * b) + 1) // 2)
else:
	print(0)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H,W = input().split()
H=int(H)
W=int(W)
if H%2==0:
  ans=(H*W)/2
else:
  ans=((H-1)*W/2)+math.ceil(W/2)
  
print('{:.18g}'.format(ans))

Submission status: Wrong Answer

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

h = A[0]
w = A[1]

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

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
getcontext().prec = 50

#ra = Decimal(a).sqrt()

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

if w % 2 == 0:
	cx0 = w // 2
	cx1 = cx0
else:
	cx0 = w // 2 + 1
	cx1 = cx0 - 1

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

Submission status: Wrong Answer

Solution code:
def resolve():
    h, w = map(int, input().split())
    dy = h // 2 if h != 1 else 1
    if h == 1 or w == 1:
        count = 1
    elif h == w and h % 2 == 1:
        count = w * dy + (w - (h//2))
    elif h % 2 == 1:
        count = w * dy + (w-1)
    else:
        count = w * dy

    print(count)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

ans = math.ceil(h*w/2)
if h == 1 and w == 1:
    ans = 0

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

MOD = 10**9 + 7

import math

if max(h, w) >= 10**4:
   h /= 10**5
   w /= 10**5

   ans = (h % MOD) * (w % MOD) * 0.5
   print(int(math.ceil(ans)*10**10))
else:
   ans = (h % MOD) * (w % MOD) * 0.5
   print(math.ceil(ans))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

H, W = map(int, input().split())
H = Decimal(H)
W = Decimal(W)
HW = H*W
print((H*W+Decimal(1))//Decimal(2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n,m = map(int, input().split())
print(math.ceil((n*m)-((n*m)/2)))

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if hw[0] == 1 or hw[1] == 1:
    count = 0
elif hw[0] % 2 == 0 and hw[1] % 2 == 0:
    count = (hw[0] * hw[1]) // 2
elif hw[0] % 2 != 0 and hw[1] % 2 == 0:
    count = ((hw[0] + 1) * hw[1] // 2) - (hw[1] // 2)
elif hw[0] % 2 == 0 and hw[1] % 2 != 0:
    count = ((hw[1] + 1) * hw[0] // 2) - (hw[0] // 2)
else:
    count = ((hw[0] + 1) * (hw[1] + 1) // 2) - ((hw[0] // 2 + 1) + (hw[1] // 2 + 1) - 1)
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

if Line[0] ==1 or Line[1] == 1:
  print("0")
else:
  print(-(-Line[0]*Line[1] // 2))

Submission status: Wrong Answer

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

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

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

H_rem = int(H % 2)
H_div = int(H / 2)
W_rem = int(W % 2)
W_div = int(W / 2)


output = 0
if (H_rem == 0):
	output = W * H_div
else:
	if (W_rem == 0):
		output = W_div * H
	else:
		output = H * W_div + H_div + 1
    
print(int(output))

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
getcontext().prec = 50

#ra = Decimal(a).sqrt()

h,w = map(int,input().split())
print(Decimal(h+w))
if w % 2 == 0:
	cx0 = w // 2
	cx1 = cx0
else:
	cx0 = w // 2 + 1
	cx1 = cx0 - 1

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

Submission status: Wrong Answer

Solution code:
H, W = (int(x) for x in input().split())

k = H * W / 2
if H * W == 1:
    k = 1
else:
    if (H == 1 or W == 1) and H*W != 1:
        a = list(filter(lambda x: x != 1, [H, W]))
        k = int(a[0] / 2) + 1
    else:
        k = int(H/2) + (int(W/2))*H + 1
print(k)

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)-(a+b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 if h > 1 else 1
w_b = w // 2 if w > 1 else 1
if(h_b == 1 & w_b == 2):
  print(1)
elif(h_b == 1):
  print(w_b if w_a == 0 else w_b + 1)
elif(w_b == 1):
  print(h_b if h_a == 0 else h_b + 1)
elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ceildiv(a, b):
    return -(-a // b)

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

if (h==1 or w==1):
    print(1)
else:
    print(ceildiv(h,2)*ceildiv(w,2) + (ceildiv(h,2)-1)*(ceildiv(w,2)-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if H == 1 and W == 1:
  c = 1
else:
  if H % 2 == 0:
    h_1 = H / 2
    h_2 = H / 2
  elif H == 1:
    h_1 = 1
    h_2 = 0
  else:
    h_1 = math.ceil(H / 2)
    h_2 = H - h_1

  if W % 2 == 0:
    width = W / 2
    c = h_1 * width
    c += h_2 * (W - width)
  elif W == 1:
    c = h_1
  else:
    width = math.ceil(W / 2)
    c = h_1 * width
    c += h_2 * (W - width)

print(math.floor(c))

Submission status: Wrong Answer

Solution code:
Y, X = map(int, input().split()) 	

num = X * Y
if num % 2 == 0:
  out = int(num / 2)
elif num % 2 == 1:
  out = int((num -1)/2 + 1)
print(out)

Submission status: Wrong Answer

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

a=W//2

b=H//2

N=a*b*2+W%2*b+H%2*a

if H%2==1 and W%2==1:
    N+=1
print(N)

Submission status: Wrong Answer

Solution code:
a = [int(x) for x in input().split(" ")]
if a[0] < 2 or a[1] < 2:
    print(0)
    exit()
kisu = a[0] // 2 if a[0] % 2 == 0 else a[0] // 2 + 1
gusu = a[0] // 2
yokokisu = a[1] // 2 if a[1] % 2 == 0 else a[1] // 2 + 1
yokogusu = a[1] // 2
ans = kisu * yokokisu + gusu * yokogusu
print(ans)