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:
a,b = (int(x) for x in input().split())
if a > b:#b対象
    anb1 = b * b 
    anb2 = ((a-b) * b)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
            
elif a < b:#a対象            
    anb1 = a * a 
    anb2 = ((b-a) * a)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(int(a / 2) * a)
    else:
        print(int(a / 2 + 1))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
number = input().split(" ")
n_1 = int(number[0])
n_2 = int(number[1])
keisan = 0
if n_1 % 2 == 1 and n_2 % 2 == 1:
    syo_1 = (n_1 + 1) // 2
    syo_2 = (n_2 + 2) // 2
    keisan = syo_1 * syo_2 + (syo_1 - 1) * (syo_2 - 1)
elif n_1 % 2 == 1 and n_2 % 2 == 0:
    syo_1 = (n_1 + 1) // 2
    syo_2 = n_2 // 2
    keisan = syo_1 * syo_2 + (syo_1 -1) * syo_2
elif n_1 % 2 == 0 and n_2 % 2 == 1:
    syo_1 = n_1 // 2
    syo_2 = (n_2 + 1) // 2
    keisan = syo_1 * syo_2 + syo_1 * (syo_2 - 1)
else:
    syo_1 = n_1 // 2
    syo_2 = n_2 // 2
    keisan = 2*(syo_1 * syo_2)
print(keisan)

Submission status: Wrong Answer

Solution code:
A = list(map(int, input().split()))
ans = 0
if A[0]%2 and A[1]%2:
  ans += 1
ans += (A[0] * A[1]) // 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:
tate,yoko=map(int,input().split())
gyou=0
masu=0
h=int(tate/2)
if yoko%2==1:
  gyou=int(yoko/2)+1
  if tate%2==1:
    #h=int(tate/2)
    #masu+=gyou*(h+1)
    #masu+=(gyou-1)*h
    masu=(2*gyou*h+gyou-h)
  else:
    masu=(2*gyou-1)*h
else:
  gyou=int(yoko/2)
  if tate%2==1:
    #masu+=gyou*(h+1)
    #masu+=(gyou)*h
    masu=(2*gyou*h+gyou)
  else:
    masu=(2*gyou)*h
print(masu)

Submission status: Wrong Answer

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

H = i[0]
W = i[1]
yoko = 0
count = 1
for i in range(W):
    if(count %2 != 0 ):
        yoko += 1
    count += 1


if(H == 1):
    print(yoko)
#横が偶数の時は、縦の偶奇によらない
elif(W % 2 == 0):
    print(yoko*H)
#横が奇数の時は、縦の偶奇による
elif(W % 2 != 0):
    #縦が偶数の時
    if(H % 2 == 0):
        print(yoko*(H//2)+(yoko-1)*(H//2))
    #縦が奇数の時
    else:
        print(yoko*(H//2+1)+(yoko-1)*(H//2))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
x,y = map(int,input().split())
print('{:.0f}'.format((x*y+1)/2))

Submission status: Wrong Answer

Solution code:
import sys

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

ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
a=0
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())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

a = ((h+1)//2) * ((w+1)//2)
b = (h//2) * (w//2)

print(a+b)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, getcontext
a, b = map(int, input().split())
getcontext().prec = 50
c = Decimal(a) * Decimal(b)
if a == 1 or b == 1:
    print(0)
else:  
    if c % 2 == 1:
        print(int(c/2)+1)
    else:
        print(int(c/2))

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

Submission status: Wrong Answer

Solution code:
from math import floor, ceil

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

#(H//2+1)*(ceil(W/2))+(H//2)*(W//2)

if H%2 == 0:
    ans = (H//2)*W
elif W%2 == 0:
    ans = (W//2)*H
else:
    ans = 0
    ans += floor(H/2) * floor(W/2)
    ans += ceil(H/2) * ceil(W/2)


print(int(ans))

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 = input().split()
h = int(h)
w = int(w)

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

print(int(count))

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())


H,W=acinput()


if H<W:
    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=(H/2)*W
else:
    tmp = (W//2)
    mod = H % 2
    res = int(H*tmp+H//2)+int(mod)
   
    #print(res,mod,int(res)+int(mod))
    
    

print(int(res))

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split()); c = 0 ; a = 0; A = 0; B = 0
import math

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

Submission status: Wrong Answer

Solution code:
HW = list(map(int,input().split()))
H = HW[0]
W = HW[1]
if type(H) is int and type(W) is int:
  if 1 <= H and W <= 10**9 and 1 <= W:
    out = H * W
    if out % 2 == 0:
       out = out/2
    else:
       out = ((out-1)/2)+1
    print(int(out))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
H,W = list(map(float,input().split()))
if H==1 or W==1:
  print("1")
ans = H*W/2
print(math.ceil(ans))

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_DOWN

H, W = map(Decimal, input().split())
HW = H*W
res = (H*W+Decimal(1))/Decimal(2)
print(res.quantize(Decimal('0'), rounding=ROUND_DOWN))

Submission status: Wrong Answer

Solution code:
#python3
from math import floor
def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(0)
        return
    ans = 0
    if h%2 == 0:
        ans = h//2 * w 
    else:
        ans =((h+1)//2)*((w+1)//2)+(((h+1)//2)-1)*(((w+1)//2)-1)
    print(ans)
main()

Submission status: Wrong Answer

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


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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

odd = (W//2) + (W%2)
even = W//2

odd_all = odd * ((H//2) + (H%2))
even_all = even * (H//2)

print(odd_all+even_all)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main(w,h):
    if w*h%2 != 0:
        return int(((w*h)+1)/2)
    else:
        return int((w*h)/2)

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

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 = (int(x) for x in input().split())

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

Submission status: Wrong Answer

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

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

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
H,W = list(map(float,input().split()))
ans = H*W/2
print(math.ceil(ans))

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 = input().split()
h = int(h)
w = int(w)

if h % 2 == 0:
    count = w * h / 2
    print('a')
else:
    count = w * (h // 2) + w // 2
    print('b')

print(int(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if n[0] % 2 == 0:
    print(int((n[0]/2)*n[1]))
    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 decimal import *
H,W=map(int,input().split())
kisuu = H//2 + H%2
gusu = H//2
if W%2 == 1:
	print(Decimal(kisuu) * Decimal((W//2 + 1)) + Decimal(gusu*(W//2)))
else:
	print(Decimal(kisuu) * Decimal((W/2)) + Decimal(gusu) * Decimal((W/2)))

Submission status: Wrong Answer

Solution code:
from math import floor, ceil

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

#(H//2+1)*(ceil(W/2))+(H//2)*(W//2)

if H%2 == 0:
    ans = (H//2)*W
elif W%2 == 0:
    ans = (W//2)*H
else:
    ans = 0
    for i in range(1,W+1):
        if i%2 == 0:
            ans += floor(H/2)
        else:
            ans += ceil(H/2)


print(int(ans))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = Decimal(H * W // 2)
if H % 2 != 0 and W % 2 != 0:
    a = (H * W + 1) // 2
else:
    a = (H * W) // 2

print(a)

Submission status: Wrong Answer

Solution code:
h,w =(int(x) for x in input().split())
if h%2 == 1 and w%2 == 1:
    a = (h*w+1)/2 
else :
    a = h*w/2 
A = int(a)
print(A)

Submission status: Wrong Answer

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

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

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*int(h/2))
	exit()
elif h % 2 != 0 and w % 2 == 0:
	print(h*w//2)
	exit()

Submission status: Wrong Answer

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

if h % 2 != 0:
  odd_row = first * (int(h/2) + 1)
else: 
  odd_row = first * int(h/2)

even_row = second * int(h/2)

print(odd_row + even_row)

Submission status: Wrong Answer

Solution code:
import math

# h = 縦, w = 横
h, w = (int(x) for x in input().split())
# 4,5 → 10

ans = 0

# 横が偶数のとき
if w % 2 == 0:
    # 縦偶数ますのとき
    if h % 2 == 0:
        # print('横偶数、縦偶数')
        ans_1 = (w / 2) * (h / 2)
        ans_2 = (w / 2) * (h / 2)
    # 縦奇数ますのとき
    else :
        # print('横偶数、縦奇数')
        a = (w / 2)
        b = (h + 1) / 2
        ans_1 = a * b
        # c = (w - 1) / 2
        # d = (h / 2)
        c = w / 2
        d = (h - 1) / 2
        ans_2 = c * d
# 横が奇数のとき
else :
    # 縦偶数ますのとき
    if h % 2 == 0:
        # print('横奇数、縦偶数')
        ans_1 = (w + 1)/ 2 * (h / 2)
        # print(ans_1)
        ans_2 = (w - 1)/ 2 * (h / 2)
        # print(ans_2)
    # 縦奇数ますのとき
    else :
        # print('横奇数、縦奇数')
        a = (w + 1) / 2
        b = (h + 1) / 2
        ans_1 = a * b
        c = (w - 1) / 2
        d = (h - 1) / 2
        ans_2 = c * d

ans = ans_1 + ans_2

print(math.floor(ans))

Submission status: Wrong Answer

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

if h==1 and w==1:
  print(0)
  quit()
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())

odd = W//2 + W%2
even = W//2

odd_all = odd * (H//2 + H%2)
even_all = even * (H//2)

print(odd_all+even_all)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
import math
input_line = input()
lines = input_line.split()
x=int(lines[0])
xx=[math.ceil(x/2),math.floor(x/2)]
y=int(lines[1])
yd=y%2
y2=int(y/2)
to=xx[0]*(y2+yd)+xx[1]*y2
print(to)

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==1:
    print(1)
elif W==1:
    print(1)
elif H==W and (H%2)==1:
    
    print(int(-(-(H*W)//2)))
elif H==2:

    print(W)
elif W==2:
    print(H)
elif H%2==0 and W%2==0:

    print(int(W*H/2))
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:
import math

inp = input()
hw = inp.split(' ')
hi = int(hw[0])
wi = int(hw[1])

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

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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%2==0 and W%2==0:
    
    print(int(W*H/2))
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:
line = raw_input()
#print(line)
line = line.split(' ')
a = int(line[0])
b = int(line[1])

x = (a + 1) // 2
y = a // 2

wynik = str(x * ((b + 1) // 2) + y * (b // 2))
if wynik[-1] == "L":
    wynik = wynik[:-1]
print(wynik)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
H,W = list(map(int,input().split()))
ans = H/2
ans *= W
print(math.ceil(ans))

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
else:
    k = int(H * W / 2)

print(k)

Submission status: Wrong Answer

Solution code:
import math
 
h,w = [int(x) for x in input().split()]
x = h*w
if x%2==0:
    print(int(x/2))
else:
    x += 1
    print(int(x/2))

Submission status: Wrong Answer

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

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+1) * w) // 2) - w // 2
    print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W=map(int, input().split())
print((H*W-(H%2)*(W%2))//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:
    print(h * idle)
elif h % 2 == 1:
    row = int(h // 2)
    print(num * row + idle)
else:
    row = int(h / 2)
    print(num * row)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

h, w = map(int,input().split())
# h = s.split()[0]
# w = s.split()[1]

ans = 0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

a = Decimal(H * (W // 2))
if H % 2 != 0 and W % 2 != 0:
    a += 1

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math
H,W = list(map(int,input().split()))
if H==1 and W==1:
  print("1")
else:
  ans = H/2
  ans *= W
  print(math.ceil(ans))

Submission status: Wrong Answer

Solution code:
import math

inp = input()
hw = inp.split(' ')
hi = int(hw[0])
wi = int(hw[1])

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

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

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

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

Submission status: Wrong Answer

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

print(int(a * b / 2) + (a * b) % 2)

Submission status: Wrong Answer

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

        # print('h:odd,w:even', count)
else:
    a = (w//2) * 2 + 1
    if h % 2 == 0:
        count = a * (h//2)
        # print('h:even,w:odd',count)
    else:
        count = a * (h//2)
        count += a//2+1
        # print('h:odd,w:odd',count)

print(count)

Submission status: Wrong Answer

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

sum = (W*H)/2

print(math.ceil(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
H, W = map(Decimal, input().split())
print(int(H*W/Decimal(2)+Decimal(0.9)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
H,W=map(int,list(input().split(" ")))
s=0
s+=(W//2+W%2)*(H//2+H%2)
s+=(W-W//2-W%2)*(H-H//2-H%2)
print(s)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
H, W = map(int, input().split())

#odd
odd_row = int(W/2)+W%2
num_odd = odd_row*(int(H/2)+H%2) 
#even
even_row = int(W/2)
num_even = even_row*(int(H/2))

print(num_even+num_odd)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
if H%2==0:
  H = H
  Ans=H/2*W
  if W ==1:
    Ans=H/2
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:
import math

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

main()

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)+(b%2)))
    else:
        print(b//2*a)
else:
    print(a//2*b)

Submission status: Wrong Answer

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

MOD = 10**9 + 7

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

H, W = map(int, input().split())
ans = H*W
if ans & 1:
    print(ceil(ans/2))
else:
    print(ans//2)

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*int(h/2))
	exit()
elif h % 2 != 0 and w % 2 == 0:
	print(h*w)
	exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())


H,W=acinput()


if H<W:
    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=(H/2)*W
else:
    tmp = (W//2)
    res = H*tmp+H//2+H%2
    #print(H//2)
    

print(int(res))