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

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

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

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

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


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

Solution (Python):
import sys

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

    return 0

if __name__ == "__main__":
    solve()

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

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

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

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

ans = ((w+1) // 2) * ((h+1) // 2)
ans += (w//2) * (h//2)
if h == 1 or w == 1:
    ans = 1
print(ans)

Solution (Python):
x,y=map(int,input().split())
fx=0
sx=0
ans=0
if x%2==0:
  fx=x//2
  sx=x//2
else:
  fx=(x+1)//2
  sx=x-fx
  
if y%2==0:
  ans=(fx+sx)*y//2
else:
  ans=((fx+sx)*(y-1)//2)+fx
if x==1 or y==1:
  ans=1
print(ans)

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

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

if W % 2 == 0:
    x = W // 2
    y = W // 2
else:
    x = W // 2 + 1
    y = W // 2

if H % 2 == 0:
    ans = (x + y) * (H // 2)
else:
    ans = (x + y) * (H // 2) + x

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

Solution (Python):
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    ans = (math.ceil(H/2) * math.ceil(W/2)) + ((H//2)*(W//2))
    print(ans)

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

Solution (Python):
import math
H,W = map(int, input().split())
if W == 1 or H == 1:
  print(1)
else:
  print(int(math.ceil(H*W / 2)))

Solution (Python):
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    exit()
if h%2==0 and w%2==0:
    print(h*w//2)
if (h+w)%2!=0:
    print(h*w//2)
if h%2!=0 and w%2!=0:
    num=(min(h,w)+1)//2
    num1=(max(h,w)+1)//2
    ans=num*num1+(num1-1)*(min(h,w)-num)
    print(ans)

Solution (Python):
H,W=map(int,input().split())
dir_H=0
dir_W=0

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

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

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

Solution (Python):


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

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

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

up = (w + 1) // 2
down = w // 2

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

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

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

if h == 1 or w == 1:
    ans = 1

print(ans)

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

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

Solution (Python):

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

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

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

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

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

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

Solution (Python):

h, w = map(int, input().split())
con = ((h * w) + 1) // 2

if min(h, w) == 1:
	print(1)
else:
	print(con)

Solution (Python):
H,W=map(int,input().split())
ww=-(-W//2)
w_=W-ww
hh=-(-H//2)
h_=H-hh

if (H==1 or W==1):
    print(1)
    exit()
print(ww*hh+w_*h_)

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

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

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


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

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline

    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        exit()
    print((h*w+1)//2)


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

if 1 in [h, w]:
    print(1)
else:
    print(math.ceil((h * w) / 2))

Solution (Python):
h,w = map(int, input().split())
area = h*w
ans =  (-area) // 2
if h != 1 and w != 1:
    print(-ans)
else:
    print(1)

Solution (Python):
s = list(map(int, input().split()))
if s[0]!=1 and s[1]!=1:
    i=(s[0]*s[1]+(s[0]%2)*(s[1]%2))/2
    print(int(i))
else:
    print(1)

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

def judge(H, W):
    if H == 1 or W == 1:
        return 1
    elif (H * W) % 2 == 1:
        return int(H * W // 2) + 1
    else: 
        return int(H * W / 2)
    
print(judge(H, W))

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

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

Solution (Python):
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)

Solution (Python):
H, W=list(map(int,input().split()))
n=(H*W)//2

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

elif (H*W) % 2 == 0:
    print(n)
else:
    print(n+1)

Solution (Python):


import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]



H, W = LI()

ans = H*W

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

Solution (Python):
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

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

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

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

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

print(ans)

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


a = int(W / 2 + 0.5)

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

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

Solution (Python):
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
    exit()

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


ans = h*w + (W-w)*(h-1)

print(ans)

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

Solution (Python):
a,b = map(int,input().split())
if a!=1 and b!=1:
  if a %2 == 0:
    
    c = int(a/2)
    print(c*b)
  else:
  
    d = int((a+1)/2)
    e = int((a-1)/2)
    if b %2 == 0:
      print(int((d+e)/2*b))
    else:
      print(int((d+e)/2*(b-1)+d))
else:
  print(1)

Solution (Python):
x,y=list(map(int, input().split()))

if x==1 or y==1:
	print(1)
elif y%2==1:
	print(((x*(y//2))+((x+1)//2)))
else:
	print((x*y)//2)

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

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

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

Solution (Python):

import numpy as np

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

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

print(int(ans))

Solution (Python):
from math import ceil
H, W = map(int, input().split())

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

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

Solution (Python):
import math

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

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

Solution (Python):
import math

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

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

Solution (Python):
import sys


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

Solution (Python):
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 = 1


print(res)

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

Solution (Python):

from collections import deque, defaultdict
import bisect
from math import factorial


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

    if H == 1 or W == 1:
        print(1)
        return
    
    odd_row_cell = W // 2 if W % 2 == 0 else (W+1) // 2
    even_row_cell = W // 2 if W % 2 == 0 else (W-1) // 2

    odd_row_num = H // 2 if H % 2 == 0 else (H+1) // 2
    even_row_num = H // 2 if H % 2 == 0 else (H-1) // 2

    num = odd_row_cell * odd_row_num\
        + even_row_cell * even_row_num

    print(int(num))


if __name__ == '__main__':
    main()

Solution (Python):
n = [int(e) for e in input().split(" ")]
if(n[0] == 1 or n[1] == 1):
    print("1")
else:
    a = n[0] * n[1]
    if(a % 2 == 0):
        print(a // 2)
    else:
        print(a // 2 + 1)

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

Solution (Python):
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    total = H * W
    print(H * W // 2 + bool(total % 2))

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

import sys

a = (W+1)//2+(W//2)

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

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

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

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

ans=0
ch=0

if h==1 or w==1:
    ch=1

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

if ch==1:
    print(1)
else:
    print(ans)

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

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

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

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

s = h * w

if s % 2:
    print(s//2+1)
else:
    print(s//2)

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

Solution (Python):
import sys
from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 

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

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

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

print(ans)

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

if h==1 or w==1:
  print(1)
else:
  ans1=math.ceil(h/2)*math.ceil(w/2)
  ans2=math.floor(h/2)*math.floor(w/2)
  print(ans1+ans2)

Solution (Python):
import math
a,b = map(int, input().split())
out = 0
num = a*b
if a == 1 or b == 1:
  out = 1
else:
  if num%2 == 0:
    out = out + (num / 2)
  else:
    out = out + (num / 2) + 1


print(math.floor(out))

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

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

    print(ans // 2)

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

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

Solution (Python):
HW = list(map(int, input().split()))

vertical = int(HW[0] / 2) + (HW[0] % 2)
horizontal = int(HW[1] / 2) + (HW[1] % 2)

if (HW[0] == 1 or HW[1] == 1):
    print(1)
else:
    pairV = 0
    secondV = 0
    if (HW[0] % 2 == 0):
        pairV = vertical * 2
    else:
        pairV = vertical * 2 - 1
    if (HW[1] % 2 == 0):
        print(pairV * int(HW[1] / 2))
    else:
        tmp = pairV * int(HW[1] / 2)
        tmp += vertical
        print(tmp)

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

Solution (Python):
import sys
H, W = map(int,input().split())
if H==1 or W==1:
    print(1)
    sys.exit()
print(-(-(H*W)//2))

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

ans = math.ceil(H/2) * math.ceil(W / 2) + math.floor(H/2) * math.floor(W/2)
if H == 1 or W == 1:
    ans = 1
print(ans)

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

    print(ans)

main()

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

Solution (Python):

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

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

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

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

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

if h % 2 == 1 and w % 2 == 1:
    tmp = ((h - 1) * (w - 1) // 2)
    print(tmp + (h // 2) + (w // 2) + 1)
    exit()

Solution (Python):


"""
Created on Sat Mar 14 21:02:27 2020

@author: morihiranaoki
"""

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

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

if H == 1 or W == 1:
    movable = 1

print(int(movable))

Solution (Python):
import math

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


if H ==1:
    print('1')
elif W ==1:
    print('1')
else:
    print(math.ceil(H*W/2))

Solution (Python):
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 + 1) // 2)

Solution (Python):

import math

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

ans = 0
if H == 1 or W == 1:
    ans = 1
else:
    q, mod = divmod(H, 2)
    if mod == 0:
        ans = W * q
    else:
        ans = W * q + math.ceil(W / 2)

print(ans)

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

Solution (Python):
import sys
import numpy as np


def main():
    h, w = map(int, input().split())
    if w == 1 or h == 1:
        print(1)
        sys.exit(0)

    if w % 2 == 0:
        a = w // 2
        b = a

    else:
        a = int(np.ceil(w / 2))
        b = a - 1

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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



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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    if n == 1 or m == 1:
        print(1)
    else:
        ans = ((m + 1) // 2) * ((n + 1) // 2)
        ans += (m // 2) * (n // 2)
        print(ans)

if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
x,y = map(int,input().split()) 
if x == 1 or y == 1:
  print(1)
else:
  print(-(-(x*y)//2))

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

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

Solution (Python):
import math
 
h, w = [int(x) for x in input().split()]
if h == 1 or w == 1:
	print(1)
else:
	print(math.ceil(h * w / 2.0))

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

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

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

main()

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

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

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

Solution (Python):
h, w = [int(i) for i in input().split()]
 
if h == 1 or w == 1:
  print(1)
elif h % 2 == 0:
  print((h // 2) * w)
else:
  if w % 2 == 0:
    print((w // 2) * h)
  else:
    print((w//2 + 1) * (h//2 + 1) + (w//2) * (h//2))

Solution (Python):
import math
h, w = map(int, input().split())
ans = math.ceil(h * w / 2)
if h == 1 or w == 1:
    ans = 1
print(ans)

Solution (Python):

h,w = list(map(int, input().split()))
h1 = h//2
h2 = h//2 + h%2
w1 = w//2
w2 = w//2 + w%2

ans = (h1*w1 + h2*w2)

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

Solution (Python):

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

Solution (Python):
h,w = map(int,input().split())
h_0 = 0
ans = 0
if h == 1 or w == 1:
    ans = 1
else:
    if h % 2 == 0:
        h_0 = h/2
        h_1 = h - h_0
    else:
        h_0 = (h//2) + 1
        h_1 = h - h_0

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

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

Solution (Python):
n,k=map(int,input().split())
j=n*k
if n!=1 and k!=1:
    if j%2==0:
        print(int(j/2))
    else:
        print(int((j+1)/2))   
else:
    print(1)

Solution (Python):

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

Solution (Python):
import sys
h, w = map(int, input().split())
hw = h*w
ans = 0
if hw % 2 == 1:
    ans += 1
if h == 1 or w == 1:
    print('1')
    sys.exit()
print(ans + (hw // 2))

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

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

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

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

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

Solution (Python):
import sys

h, w = map(int, sys.stdin.readline().split())

def main():
    if w == 1 or h == 1:
        return 1
        
    res = h // 2 * w
    if h & 1:
        res += (w + 2 - 1) // 2
    return res

if __name__ == "__main__":
    ans = main()
    print(ans)

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

Solution (Python):
import sys
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
    sys.exit()
if w % 2 == 0:
    a = (w//2) * 2
    b = (w//2)
else:
    a = (w//2) * 2 + 1
    b = (w//2) + 1
if h % 2 == 0:
    print(a * (h//2))
else:
    print(a * (h//2) + b)

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

Solution (Python):
import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

h,w = nm()
if h == 1 or w == 1:
    print(1); exit()
ans = w * (h // 2)
if h%2: ans += (w+1)//2
print(ans)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline

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

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


if __name__ == "__main__":
    main()

Solution (Python):
a = list(map(int,input().split( )))
H = a[0]
W = a[1]
b = H//2
c = H//2
if H%2 == 1:
  b = b+1

d = W//2
answer = (b+c)*d
if W%2 == 1:
  answer = answer + b

if H==1 or W==1:
  answer = 1

print(answer)

Solution (Python):
def resolve():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        return
    print((h * w + 1) // 2)
    

if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
from math import ceil 
H,W = map(int,input().split())

if H == 1 or W == 1:
    print(1)
else:
    print(ceil(H*W/2))

Solution (Python):


a,b=map(int, input().split())

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

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

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

Solution (Python):

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    h,w=list(map(int, readline().strip().split()))

    if w==1:
        print(1)
        return

    if h==1:
        print(1)
        return

    ki=(w+1)//2
    gu=w//2

    amari=h%2
    half=h//2
    masu=(amari+half)*ki+half*gu
    
    
    print(masu)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

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

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

Solution (Python):
import sys
input = sys.stdin.readline

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

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

allmas = h*w

if allmas % 2 == 1:
    print(int((allmas/2) + 0.5))
else:
    print(int(allmas/2))

Solution (Python):
a,b=map(int,input().split())
c=a*b
if a==1 or b==1:
    print(1)
else:


    print(c-(c//2))