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


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

h,w = LI()
H, W = math.ceil(h/2), math.ceil(w/2)
if h == 1 or w == 1:
    print(1)
    quit()
ans = H * W + (h//2) * (w//2)
print(ans)

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

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

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

N=H*W

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

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

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

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

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

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

dep = h // 2
wid = w // 2

if h % 2 == 0:
    print(dep * w)
else:
    print((dep + 1) * (w - wid) + dep * wid)

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

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

q, mod = divmod(H * W, 2)

if H == 1 or W == 1:
    ans = 1
elif mod == 0:
    ans = q
else:
    ans = q + mod

print(ans)

Solution (Python):
import sys
H, W = map(int, sys.stdin.readline().rstrip().split())

if W == 1 or H == 1:
    print(1)
else:
    h_syou, h_amari = divmod(H, 2)
    w_syou, w_amari = divmod(W, 2)
    if w_amari == 0:
        print(w_syou * H)
    else:
        print((w_syou * H) + h_syou + h_amari)

Solution (Python):



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

ans = H * W // 2

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

if H == 1 or W == 1:
    ans = 1

print(ans)

Solution (Python):

import math

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

m = (h * w)

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

if m % 2 == 0:
    print(int(m / 2))
else:
    print(math.floor(m / 2) + 1)

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

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

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

Solution (Python):

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

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

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(int((h*w)/2))

else:
  print(int(h*w/2 + 1))

Solution (Python):

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

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

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

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

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

H_g = H//2
H_k = H - H_g

W_g = W//2
W_k = W - W_g
if H ==1 or W == 1:
    print(1)
else:
    print(H_g*W_g+H_k*W_k)

Solution (Python):
def solve():
    N, K = [int(_) for _ in raw_input().split()]
    if N == 1 or K == 1:
        ret = 1
    elif N % 2 == 0 or K % 2 == 0:
        ret = N * K /2
    else:
        ret = N * K /2 + 1
    print ret

if __name__ == '__main__':
    solve()

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

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

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

print(ans)

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

Solution (Python):
L, S = map(int, input().split())

if L % 2 == 1 and S % 2 == 1:
    ans = int(L*(S-1)/2 + (L+1)/2)
else:
    ans = int(L*S/2)

if L == 1 or S == 1:
    ans = 1

print(ans)

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

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

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

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

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

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

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

Solution (Python):
s=input().split(" ")
H=int(s[0])
W=int(s[1])
if H==1 or W==1:
    print(1)
elif H%2==1 and W%2==1:
    print((H*W)//2+1)
else:
    print(H*W//2)

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

Solution (Python):
import math

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

if h == 1 or w == 1:
    print(1)
    exit(0)
print(math.ceil(h * w / 2.0))

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

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

Solution (Python):
import sys
import math


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

Solution (Python):
from math import ceil
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

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

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



if __name__ == "__main__":
    main()

Solution (Python):

import sys
import math

def solve(H: int, W: int):
    count = 0
    if H == 1 or W == 1:
        print(1)
        return
    if H % 2 == 0:
        count += (H / 2) * math.ceil(W/2) 
        count += (H / 2) * math.floor(W/2) 
    else:
        count += (1 + (H // 2)) * math.ceil(W/2)
        count += (H // 2) * math.floor(W/2) 

    count = int(count)
    assert type(count) == int
    print(count)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  
    W = int(next(tokens))  
    solve(H, W)

if __name__ == '__main__':
    main()

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

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

if 1 in [H, W]:
    print(1)

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

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

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

hq, hmod = divmod(h, 2)
wq, wmod = divmod(w, 2)

if(h == 1 or w == 1):
  ans = 1
else:
  ans = hq * w + hmod * (wq + wmod)
  
print(ans)

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

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

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

Solution (Python):
def mi():return map(int,input().split())

h,w=mi()

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

Solution (Python):
a,b = [int(x) for x in input().split()]
ans = int(a*b/2)+1
if a == 1 or b == 1:
  ans = 1
elif (a*b) % 2 == 0:
  ans = int(a*b/2)
print(ans)

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

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

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

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
else:
    a = (w // 2) + 1

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

Solution (Python):
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
    exit()
a = -(-H//2)
b = -(-W//2)
c = H//2
d = W//2
print(a*b+c*d)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):


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

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
ans = ((H+1)//2)*((W+1)//2) + (H//2)*(W//2)

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

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

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

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

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

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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


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

Solution (Python):
from math import ceil
h, w = [int(i) for i in input().split()]
print(ceil(h*w/2)) if h != 1 and w != 1 else print(1)

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

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

odd = W // 2 + 1
even = W // 2

answer = 0
if W % 2 != 0 and W != 1 and H != 1:
    if H % 2 == 0:
        answer = (odd + even) * (H // 2)
    else:
        answer = (odd + even) * (H // 2) + odd
else:
    answer = even * H

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

print(answer)

Solution (Python):
import sys
l = sys.stdin.readline().strip()

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

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

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

Solution (Python):
import sys

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

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

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

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate
    
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):

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


if __name__ == "__main__":
    main()

Solution (Python):
import math

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

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

odd = int(math.ceil(W / 2.0) * math.ceil(H / 2.0))
even = int(math.floor(W / 2) * math.floor(H / 2))

print(odd + even)

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):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

H, W = input_nums()

horizontal = 0
ans = 0

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

Solution (Python):
import math
if __name__ == "__main__":
    H, W = map(int, input().split())
    ret = H * W
    if H == 1 or W == 1:
        ret = 1
    elif ret % 2 == 0:
        ret = ret / 2
    else:
        ret = math.floor(ret / 2) + 1
    print(int(ret))

Solution (Python):
import math

h, w = [int(v) for v in input().split()]
if 1 in [h, w]:
    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)
else:
    print(H * W // 2 + H * W % 2)

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

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

if W == 1 or H == 1:
    print(1)
elif W % 2 == 0:
    w = W // 2
    print(H * w)
else:
    w1 = W // 2 + 1
    w2 = w1 - 1
    if H % 2 == 0:
        h = H // 2
        print(h * w1 + h * w2)
    else:
        h1 = H // 2 + 1
        h2 = h1 - 1
        print(h1 * w1 + h2 * w2)

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

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

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

print(ans)

Solution (Python):
h, w  = [int(x) for x in 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:
    print(1)
    exit()
if W==1:
    print(1)
    exit()

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

Solution (Python):
import sys
a,b= list(map(int,input().strip().split()))
x=a*b
if(a==1 or b==1):
	print(1)
	sys.exit()
if(x%2!=0):
	x=x+1
print(x//2)

Solution (Python):

if False:
    A=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    K=int(input())
    print(A[K-1])


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

if False:
    A,B,C=map(int,input().split())
    if 4*A*B<(C-A-B)**2:
        if C-A-B>=0:
            print('Yes')
        else:
            print('No')
    else:
        print('No')

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


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

Solution (Python):
import sys

H, W = map(int, sys.stdin.readline().strip().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)

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

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
 
n,m=IA()
if n==1 or m==1:
  print(1)
else:
  print((n*m+1)//2)

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

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

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

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())
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):
def solve():
    h, w = list(map(int, input().split()))
    
    if w == 1 or h == 1:
        print(1)
        return
    
    _odd = ((w + 1) // 2) * ((h + 1) // 2)
    _even = (w // 2) * (h // 2)

    print(_odd + _even)

if __name__ == "__main__":
    solve()

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

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

Solution (Python):

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

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

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

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

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

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

T = H * W

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

Solution (Python):
from math import ceil
h, w = [int(i) for i in input().split()]

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

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

while True:
    if H==1 or W==1:
        print(1)
        break

    if S%2==0:
        print(int(S/2))
        break
    elif S%2==1:
        print(int(S//2+1))
        break

Solution (Python):
if __name__ == '__main__':
    h, w = map(int, input().split())
    count = 0
    if h == 1 or w == 1:
        count = 1
    else:
        count =(h*w) //2

        if (h*w) % 2:
            count = count +1
    print(count)

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

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

Solution (Python):
from math import ceil

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

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

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

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

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

Solution (Python):
from sys import stdin
import numpy as np
from operator import itemgetter


H, W = [int(x) for x in stdin.readline().rstrip().split()]


MOD = 10**9 + 7
H_2 = H//2
W_2 = W//2

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

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

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

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

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

w1 = math.ceil(W/2)*math.ceil(H/2)
w2 = math.floor(W/2)*math.floor(H/2)

if H == 1:
    print(1)
elif W==1:
    print(1)
elif W != 1:
    print(w1+w2)

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):
hw = list(map(int, input().split()))
h = hw[0]
w = hw[1]

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

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

if h == 1 or w == 1:
    print(1)
else:
    import math
    h_odds = math.ceil(h / 2)
    h_evens = h // 2
    w_odds = math.ceil(w / 2)
    w_evens = w // 2
    print(h_odds * w_odds + h_evens * w_evens)

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

masu=masu+(w*(h//2))

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

if h==1 or w==1:
    masu=1

print(masu)

Solution (Python):
import math
h, w = map(int, input().split())
if h == 1 or w == 1:
    print(1)
    exit()

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

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

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

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

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

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

    if H == 1 or W == 1:
        print("1")
        exit(0)
    
    if H % 2 == 0:
        print(H // 2 * W)
    else:
        ans = H * (W // 2)
        if W % 2 == 1:
            ans += H // 2 + 1
        print(ans)
if __name__ == '__main__':
    solve()

Solution (Python):
import math

h, w = (int(item) for item in 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)
else:
  print((h*w+1) // 2)

Solution (Python):
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()

if H == 1 or W == 1:
    print(1)
else:
    print(ceil(H * W / 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):
a = input().split()
h, w = int(a[0]), int(a[1])

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

Solution (Python):
n, m = [int(s) for s in input().split()]
if n == 1 or m == 1:
    ans = 1
elif not n%2:
    ans = (n//2)*m
else:
    ans = (n//2)*m + m//2 + m%2
print(ans)