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 = input().split()
Hnum = int(H)
Wnum = int(W)
counter = 0
tmp = 0
if Hnum%2 == 0:
    counter = int(Hnum/2 * Wnum)
else:
    for i in range(1,Wnum+1):
        if i%2 ==1:
            tmp += 1
    Hnum -=1        
    counter = int(Hnum/2 * Wnum +tmp)
    print(tmp)

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
s = input().rstrip().split(' ')
height = int(s[0])
width = int(s[1])
area = height * width
print(int(math.copysign(math.ceil(abs(area / 2)), (area / 2))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B=map(int, input().split())
C=A*B//2
D=A*B%2
E=C+D
print(E)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

h, w = LI()
if w == 1:
    print(1)
else:
    print((h * w + 1) // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

odd = ((h+1)//2) * ((w+1)//2)
even = (h//2) * (w//2)

print(odd+even)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

print(res)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
HH = i[0]
WW = i[1]
atai = HH*WW
ans = int(atai/2) + (atai % 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//2 + 1)
else:
  print(H*W//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

odd_reach = -1
even_reach = -1
if (H % 2 == 1) :
    odd_reach = (H // 2 + 1)
    even_reach = (H // 2 )
else :
    odd_reach = (H // 2)
    even_reach = (H // 2)

# print("odd_reach : ", odd_reach, ",even_reach : ", even_reach)
reachable = 0
if (W % 2 == 1) :
    odd_row = (W // 2) + 1
    even_row = (W // 2)
    reachable = odd_reach * odd_row
    reachable += even_reach * even_row
else :
    odd_row = (W // 2) 
    even_row = (W // 2) 
    reachable = odd_reach * odd_row
    reachable += even_reach * even_row

# print("odd_row : ", odd_row, ",even_row : ", even_row)
print(reachable)

Submission status: Wrong Answer

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

a = H * W


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#
import math


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

h,w = map(int,input().split())
#１列の縦に何個か
count = 0
for i in range(0,h,2):
    count += 1
#print(count)
if h % 2 == 0:
    print(count * w)
else:
    #a = math.ceil(w/2)
    a = math.floor(w/2)
    print(a)
    print((w - a) * count + (count - 1) * a)

Submission status: Wrong Answer

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

if w%2 == 0:
  w_ = w//2
else:
  w_ = w//2 + 1

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

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

Submission status: Wrong Answer

Solution code:

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
H, W = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Wrong Answer

Solution code:
import math

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 = (h // 2) * (cx0 + cx1)
else:
	ans = (h // 2) * (cx0 + cx1) + cx0
print(ans)

Submission status: Wrong Answer

Solution code:
import math
h,w=[int(x) for x in input().split()]
print(math.ceil((h*w)/2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    h, w = LI()
    ans = 0
    x = (h + 1) // 2
    y = h // 2
    ans += (w + 1) // 2 * x
    ans += w // 2 * y
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [input().split() for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    h,w=map(int,input().split())
    res = 0
    if w % 2 != 0:
        res = (w//2+1) * (h//2) + (w//2) * (h//2)
    else:
        res = w//2 * h
    if h % 2 != 0:
        if w % 2 != 0:
            res += (w//2+1) 
        else:
            res += w//2
    print(res)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

if R % 2 == 0:
  n = R/2
  print(int(n * C))
else:
  n1 = (R+1) / 2
  n2 = n1 - 1
  c1 = int((C+1)/2)
  c2 = C -c1
  print(int(n1*c1 + n2*c2))

Submission status: Wrong Answer

Solution code:
import bisect,collections,itertools,math,numpy,string
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
##################################################
def main(H,W):
    if H==W==1:
        return 1
    elif H==1:
        if W%2==0:
            return W//2
        else:
            return W//2 +1
    elif W==1:
        if H%2==0:
            return H//2
        else:
            return H//2 +1
    elif H%2==0 and W%2==0:
        return (H*W)//2
    elif H%2==0 and W%2==1:
        return (H//2)*(2*(W//2)+1)
    elif H%2==1 and W%2==0:
        return (2*(H//2)+1)*(W//2)
    else:
        return (H//2)*(2*(W//2)+1)+2*(W//2)
    return _HW
    
H,W = LI()
print(main(H,W))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def f(h, w):
    if h % 2 == 0 and w % 2 == 0:
        return (h // 2) * w
    elif h % 2 == 1 and w % 2 == 0: 
        return f(h - 1, w) + w // 2
    elif h % 2 == 0 and w % 2 == 1: 
        return f(h, w - 1) + h // 2
    else:
        return f(h - 1, w) + w // 2 + 1

print(f(H, W))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    Ans = (H // 2 + H % 2) * (W // 2 + W % 2) + (H // 2) *  (W // 2)
    print(Ans)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

Z = H * W % 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
a = input().split()
#print(a)

H = int(a[0])
W = int(a[1])

c = 0
for i in range(H):
  if i % 2 == 0:
    c += math.floor(W / 2) + 1  
  else:
    c += math.floor(W / 2)

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

h_h = H // 2
w_h = W // 2
h_l = H - h_h
w_l = W - w_h

ans = h_h*w_h + h_l*w_l
print(ans)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
datas = input().split(" ")

h = int(datas[0])
w = int(datas[1])


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

Submission status: Wrong Answer

Solution code:
A,B=map(int, input().split())
print(A,B)
C=A*B//2
D=A*B%2
E=C+D
print(E)

Submission status: Wrong Answer

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

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())
ans = 0
if W % 2 == 0:
    f, n = W // 2, W // 2
else:
    f = math.ceil(W / 2)
    n = f - 1

if H % 2 == 0:
    kakeru = H // 2
    ans += f * kakeru + n * kakeru
else:
    kakeru = math.ceil(H / 2)
    n_kakeru = H - (H // 2)
    ans += f * kakeru + n * n_kakeru
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = inp[0]*inp[1]

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

print('{:.25g}'.format(b))

Submission status: Wrong Answer

Solution code:
import math

h,w = list(map(int,input().split()))
x = (h*w)
if h ==1 and w == 1:
	print(1)
else:
	y = int(x /2)
	if x%2 == 0:
		print(y)
	else:
		print(y+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import re

l = sys.stdin.readline()
l = l.split(' ')
l = [int(str) for str in l]

h = l[0]
w = l[1]

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

print(out)
sys.stdout.flush()

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
ans = 0
wx = W // 2
hx = H // 2
wy = W % 2
hy = H % 2

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
h,w = map(int,input().split())
# 奇数番目は(h+1)//2 個取れる　偶数番目はn//2
ans = ((h+1)//2) * ((w+1)//2) + (h-(h+1)//2) * (w-(w+1)//2)
ans2 = h*(w//2)+((h+1)//2 ) * (w%2)
"""for h in range(100,10000000):
    for w in range(1,10000):
        ans = ((h+1)//2) * ((w+1)//2) + (h-(h+1)//2) * (w-(w+1)//2)
        ans2 = h*(w//2)+((h+1)//2 ) * (w%2)

        if ans != ans2:
            print(i,j, "not matched")"""
print(ans2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

square_num = h * w
result = square_num / 2
if square_num % 2 == 1:
    result += 1
print(result)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    H, W = map(int, input().split())

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

main()

Submission status: Wrong Answer

Solution code:
#スペース区切りの整数の入力
A, B = map(int, input().split())

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

Submission status: Wrong Answer

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

q_h,m_h = divmod(h,2)

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

print(int(ans))

Submission status: Wrong Answer

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

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

# 総マス数が偶数になる場合、半数が答え
total = h * w
if total % 2 == 0:
    print(int(total / 2))
    exit()

# 問題は奇数の場合
# 高さが奇数の場合、奇数列はh//2+1 偶数列はh//2
if h % 2 != 0:
    odd_column = (h//2 + 1) * (w//2 + 1)
    even_column = (h//2) * (w//2)
    res = odd_column + even_column

print(int(res))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    b()

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
v, mod = divmod(h*w, 2)
print(v+mod)

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:
def main():
    a, b = map(int, input().split())
    m1 = (b + 1) // 2
    m2 = b // 2
    if a % 2 == 0:
        ans = (a // 2) * (m1 + m2)
        print(ans)
    else:
        ans = (a // 2) * (m1 + m2) + m1
        print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=input().split(' ')
a=[int(x) for x in a]
if a[1]%2==0:
    c=a[1]/2
else:
    c=a[1]//2+1
ans=0
for i in range(a[0]):
    if i%2==0:
        ans+=c
    else:
        ans+=c-1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

h,w = list(map(int,input().split()))
x = (h*w)
if h ==1 and h == 1:
	print(1)
else:
	y = int(x /2)
	if x%2 == 0:
		print(y)
	else:
		print(y+1)

Submission status: Wrong Answer

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import heapq
import collections
import itertools
sys.setrecursionlimit(100001)

# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

# n, m = map(int, input().split())

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

ans = 0
ans += w * (h//2)

if h % 2 == 1:
    ans += w//2 + (w % 2)

print(int(ans))

Submission status: Wrong Answer

Solution code:
H = input().split()
h = int(H[0])
w = int(H[1])
if h % 2 == 1:
    if w % 2 ==1:
        print(int((h/2 +0.5) * (w/2 +0.5) + (h/2 -0.5) * (w/2 -0.5)))
    else:
        print(int((w/2 * h)))
elif w % 2 ==1:
    print(int(h/2*w))
else:
    print(int(h/2 *w))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import math

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    if w % 2 == 1:
        w1 = w - 1
    else:
        w1 = w

    if h % 2 == 1:
        h1 = h - 1
    else:
        h1 = h

    cnt = w1 * h1 // 2
    if h1 != h and w1 != w:
        cnt += 1

    if h1 != h:
        cnt += w1 // 2

    if w1 != w:
        cnt += h1 // 2
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

kisuu = (w+1)//2
guusuu = w//2
tate_kisuu = (h+1)//2
tate_guusuu = h//2


res = kisuu*tate_kisuu+guusuu*tate_guusuu

if(h==1)or(w==1):
    res = 0


print(res)

Submission status: Wrong Answer

Solution code:
x = list( map(int, input().split()) )
h = x[0]
w = x[1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if h > 1 and w == 1:
    ans = 1
elif w > 1 and h == 1:
    ans == 1

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil
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:
n,m=map(int,input().split())
print(m*(n//2)+(m//2+m%2)*(n%2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = h*w;
if ans & 1:
    ans = (ans>>1)+1
else:
    ans = (ans>>1)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

ans = ceil(h/2) * ceil(w/2) + int(h/2) * int(w/2)
print(int(ans))