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

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

Solution (Python):
import sys

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

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

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

Solution (Python):
from collections import deque
import sys
sys.setrecursion = 10000000


def solve(): 
  h,w = (int(i) for i in input().split())
  if h==1 or w == 1:
    print(1)
  else:
    print((h*w+1)//2)


solve()

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

Solution (Python):
h,w = (int(num) for num in input().split())
if h != 1 and w != 1:
    print((h * w + 1) // 2)
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())

if min(H, W) == 1:
    print(1)
    exit()

ans = W * (H // 2)

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

print(ans)

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

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

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

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

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

Solution (Python):
import math
h, w = map(float, 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 min(h, w) == 1:
    ans = 1
else:
    ans = w * (h // 2)
    if h % 2:
        ans += (w + 1) // 2
print(ans)

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

Solution (Python):
h, x = map(int, input().split())
ho = h // 2
he = ho + (h % 2)
xo = x // 2
xe = xo + (x % 2)

if h == 1 or x == 1:
    print(1)
else:
    print(ho * xo + he * xe)

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

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

ans = 0

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

print(ans)

Solution (Python):
a,b = list(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())
print((H * W + 1) // 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)
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)
elif(H * W ) % 2 == 0:
    print((H * W) // 2)

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

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

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 math

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

print( 1 if a == 1 or b == 1 else math . ceil(a * b / 2))

Solution (Python):


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

import math
if w == 1:
    print(1)
elif h == 1:
    print(1)
else:
    print(math.ceil(w*h/2))

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

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

Solution (Python):
H,W = list(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):
import math

H, W = map(int, input().split())
 
num = H * W
if (H == 1 or W == 1):
    print(1)
else:
    print(math.ceil(num/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 math

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

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

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

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

def f(h, w):
    if h == 1 or w == 1:
        return 1
    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))

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

n = h * w
if min(h, w) == 1:
    print(1)
elif n % 2 == 0:
    print(int(n / 2))
else:
    print(int(-(-n // 2)))

Solution (Python):






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


def main():
    if H == 1 or W == 1:
        print(1)
        return
    a = b = H // 2
    if H % 2 == 1:
        a += 1
    ans = (a + b) * (W // 2)
    if W % 2 == 1:
        ans += a
    print(ans)


if __name__ == "__main__":
    main()

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

w1 = math.ceil(w/2)
w2 = math.floor(w/2)

h1 = math.ceil(h/2)
h2 = math.floor(h/2)

if h==1 or w==1:
    print(1)
    exit(0)
print((h1*w1) + (h2*w2))

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

Solution (Python):

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

Solution (Python):
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(4, 5), 10)

    def test_2(self):
        self.assertEqual(think(7, 3), 11)


def solve():
    h, w = read()
    result = think(h, w)
    write(result)


def read():
    return read_int(2)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(h, w):
    if h == 1 or w == 1:
        return 1
    if w % 2 == 0:
        return w // 2 * h
    else:
        if h % 2 == 0:
            return w * (h // 2)
        else:
            return w * (h // 2) + (w // 2) + 1


def write(result):
    print(result)


if __name__ == '__main__':
    
    solve()

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


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

    print((H//2)*less + ((H+1)//2) * more)

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

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):
n=list(map(int,input().strip().split()))

h=n[0]
w=n[1]

htw=h*w+1

if(h!=1 and w!=1):
    print(int(htw/2))
else:
    print(1)

Solution (Python):
import sys

input = sys.stdin.buffer.readline







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



if __name__ == "__main__":
	main()

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

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

if H>1 and W>1:
    print(((H + 1) // 2) * ((W + 1) // 2) +
        (H - (H + 1) // 2) * (W - (W + 1) // 2))
else:
    print(1)

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

Solution (Python):
a,b = (int(x) for x in input().split())

            
if a == 1 or b == 1:
    print(1)
elif a > b:
    anb1 = int(b * b) 
    anb2 = (int((a-b) * b))
    if (anb1 % 2) == 0:
            print(int(anb1/2) + int(anb2/2))
    else:
            print(int(anb1/2 + 1) + int(anb2/2))
elif a < b:
    anb1 = int(a * a)
    anb2 = int((b-a) * a)
    if (anb1 % 2) == 0:
            print(int(anb1/2) + int(anb2/2))
    else:
            print(int(anb1/2 + 1) + int(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(int(a / 2) * a)
    else:
        print(int((a * a) / 2) + 1)

Solution (Python):
a = input().split()

b = [int(s) for s in a]
c = b[0]*b[1]/2

if(b[0] == 1 or b[1] == 1):
  print(1)
elif(int(b[0]*b[1])%2 != 0):
  print(int(c+1))
else:
  print(int(c))

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

if H == 1 or W == 1:
  print(1)
else:
  print(math.ceil(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 % 2 == 1 and w % 2 == 1:
  print(int(h*w//2 + 1))
else:
  print(int(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, b = map(int,input().split())

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

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


main()

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

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

ans=h*(w//2)

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

print(ans)

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

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

if W == 1:
    N = 1

elif H == 1:
    N = 1

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

print(int(N))

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

Solution (Python):
H, W = map(int, input().split())
ans = H * W // 2
if H == 1 or W == 1:
    ans = 1
elif (H & 1) and (W & 1):
    ans += 1


print(ans)

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,b = list(map(int,input().split()))
a,b = max(a,b),min(a,b)

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

Solution (Python):
h,w=map(int,input().split())
tmp=0
tmg=0
if h%2!=0:
    tmp=1+h//2
    tmg=h//2
else:
    tmp=h//2
    tmg=tmp

ans=0
if w%2!=0:
    ans=tmp*(1+w//2)+tmg*(w//2)
else:
    ans=tmp*(w//2)+tmg*(w//2)
if h==1 or w==1:
    print(1)
    exit()
print(ans)

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

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

Solution (Python):
l = list(map(int, input().split()))
x=l[0]*l[1]
if l[0]==1 or l[1]==1:
    print('1')
elif x%2==0:
    print(int(x/2))
else:
    print(int(x//2)+1)

Solution (Python):

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

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

Solution (Python):
def b():
    h, w = map(int, input().split())
    if (h == 1) or (w == 1):
        print("1")
    else:
        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)


def c():
    a, b, c = map(int, input().split())
    ab = 4 * a * b
    a_b_c = c - (a + b)
    a_b_c_2 = a_b_c ** 2
    if a_b_c <= 0:
        print("No")
    else:
        if ab < a_b_c_2:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    b()

Solution (Python):
import math

a, b = map(int, input().split())
if a == 1 or b ==1:
    print(1)
else:
    x = a*b
    print(math.ceil(x/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((H//2+1)*(W//2+1)+(H//2)*(W//2))
elif H % 2 == 1 and W % 2 == 0:
    print((H//2+1)*W//2+(H//2)*(W//2))
elif H % 2 == 0 and W % 2== 1:
    print((H//2)*(W//2+1)+(H//2)*(W//2))    	 
else:
    print(2*(H//2)*(W//2))

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

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


main()

Solution (Python):
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
    quit()
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):
h,w = map(int,input().split())

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

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

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

Solution (Python):
h, w = map(int, input().split())
def guki(n):
    if n%2 == 0:
        return "gu"
    else:
        return "ki"

def check(h, w):
    if h == 1 or w == 1:
        return 1
    else:
        if guki(w) == "gu":
            k = w//2
            g = w//2
            if guki(h) == "gu":
                return (k+g)*(h//2)
            else:
                return (k+g)*(h//2)+k
        else:
            k = w//2 + 1
            g = k-1
            if guki(h) == "gu":
                return (k+g)*(h//2)
            else:
                return (k+g)*(h//2)+k

print(check(h, w))

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

Solution (Python):


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

if a == 1 or b == 1:
    print(1)

elif a % 2 == 1 and b % 2 == 1:
    print(a * b // 2 + 1)
    

else:
    print(a * b // 2)

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

Solution (Python):
A = [int(a) for a in input().split()]
masu=int((A[0]*A[1]/2)+0.5)
if A[0]==1 or A[1]==1:
    print(1)
else:
    print(masu)

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

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

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 math
x,y=map(int,input().split())
if x==1 or y==1:
    print(1)
else:    
    a=math.ceil(x/2)
    b=math.floor(x/2)
    if(y%2==0):
        print((a+b)*y//2)
    else:
        print(a*(y//2+1)+b*(y//2))

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    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)

if __name__ == '__main__':
    main()

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

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

Solution (Python):



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

if __name__=='__main__':
  main()

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

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+0.5))

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)
else:
    print((h*w)//2 if h%2==0 else ((h-1)*w)//2-(-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
h, w = map(int, input().split())

if h == 1 or w == 1:
    print(1)
    sys.exit()
count_1 = (h+1) // 2
count_2 = h // 2

loop_num = w // 2
add_num = w - (loop_num * 2)
print((count_1+count_2) * loop_num + (count_1 * add_num))

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

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

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

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

  print(count)

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

Solution (Python):

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

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

Solution (Python):
import sys
def LI():
	return [ int(s) for s in input().split() ]
 
H,W = LI()
 
if H == 1 or W == 1:
  print(1)
  sys.exit()
 
if 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%2==0 or W%2==0:
    print((H*W)//2)
else:
    print((H*(W-1))//2+H//2+1)

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

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

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

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

Solution (Python):
x,y = map(int,input().split())
if x == 1 or y == 1:
    print(1)
elif (x*y)%2==1:
    print(((x*y)//2)+1)
else:
    print(x*y//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
elif (H*W) % 2 == 1:
  ans = (H*W)//2 + 1

print(ans)

Solution (Python):
s=input().rstrip().split()
h=int(s[0])
w=int(s[1])
res =0
if h == 1 or w == 1:
  res = 1
elif h%2==0:
    res = (h/2) * w
else:
    if w%2==0:
        res = int(h/2) * w +  w/2  
    else:
        res = int(h/2) * w + int(w/2) + 1
print(int(res))

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

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

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

Solution (Python):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
h,w = i2()
if h == 1 or w == 1:
    print(1)
    exit()
print(h*w//2 if h*w%2 == 0 else h*w//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):
h, w = map(int, input().split())

h_num, h_m = divmod(h, 2)
w_num, w_m = divmod(w, 2)

ans = 2 * h_num * w_num
if h_m == 1 and w_m == 1:
    ans += h_num + w_num + 1
elif h_m == 1:
    ans += w_num
elif w_m == 1:
    ans += h_num

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

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

Solution (Python):
HW = input().split()
HW = [int(n) for n in HW]

if HW[0] == 1 or HW[1] == 1:
    print(1)
else:
    m = HW[0]*HW[1]
    if HW[0]%2==1 and HW[1]%2==1:
        print(int(m/2)+1)
    else:
        print(int(m/2))

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

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    h,w = LI()
    if h < 2 or w < 2:
        return 1

    return (h*w+1) // 2


print(main())

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

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

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

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

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

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

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

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

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

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

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

Solution (Python):


import sys
sys.setrecursionlimit(300000)


def solve(H: int, W: int):
    if H == 1 or W == 1:
        ret = 1
    else:
        ret = ((W + 1) // 2) * ((H + 1) // 2) + (W // 2) * (H // 2)
    print(ret)
    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):
def main():
    H, W = map(int, input().split())
    if H == 1 or W == 1:
        print(1)
        return

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


if __name__ == '__main__':
    main()

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):
from math import floor, ceil

H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    even_col = ceil(H / 2)
    even_row = ceil(W / 2)
    odd_col = floor(H / 2)
    odd_row = floor(W / 2)
    print(even_col * even_row + odd_col * odd_row)

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

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

ans = H*W//2
carry = H*W % 2
ans += carry

print(ans)

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

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

Solution (Python):
h, w = map(int, raw_input().strip().split())
if min(h, w) == 1:
  print 1
else:
  print str((h * w + 1) / 2)