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

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

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

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

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

s = (h * w) // 2

if (h==1) or (w==1):
    t = 1
elif (h*w) % 2 == 0:
        t = s
elif (h*w) % 2 == 1:
        t = s+1

print (t)

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

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

Solution (Python):
import math

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

main()

Solution (Python):
A,B=(int(x) for x in input().split())
a = int(A) % 2
b = int(B) % 2
if int(A) == 1 or int(B) == 1:
    print("1")

elif int(a) != 0 and int(b) != 0:
    mod = (int(A)*int(B)) % 2
    n = ((int(A) * int(B)) // 2) + int(mod)

    print(n)
else :
    n = (int(A) * int(B)) //2
    print(n)

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

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

Solution (Python):
from math import ceil

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

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

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

else:
    if(H%2 == 0):
        i = H//2
    if(H%2 != 0):
        i = H//2 + 1
    
    j = H-i

    if(W%2 == 0):
        sum = i*(W//2) + j*(W//2)

    if(W%2 != 0):
        sum = i*(W//2 + 1) + j*(W//2)
    

    print(sum)

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

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

Solution (Python):

import math
h, w = map(float, 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 and w > 1:
    print((h * w + 1) // 2)
else:
    print(1)

Solution (Python):
hw = input('')
h = int(hw.split(' ')[0])
w = int(hw.split(' ')[1])
if h == 1:
  
  result = 1
elif w == 1:
  
  result = 1
else:
  if h%2 == 0:
    if w%2 == 0:
      
      result = w // 2  * h 
    else:
      
      result = (w//2 + 1) * h//2 + (w//2 * h//2)
  else:
    if w%2 == 0:
      
      result = (w//2) * h
    else:
      
      result = (w//2 + 1) * (h//2+1) + ( (w//2) * (h//2))
print(result)

Solution (Python):
def ceildiv(a, b):
    return -(-a // b)

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

if (h==1 or w==1):
    print(1)
else:
    r0 = ceildiv(w,2)
    r1 = w//2
    r0s = ceildiv(h,2)
    r1s = h//2
    print(r0*r0s + r1*r1s)

Solution (Python):
h,w = map(int,input().split())
if w == 1 or h == 1:
    ans = 1
    
else:
    if h % 2 ==0:
        tate = h // 2
        ans = tate * w
    else:
        tate = h // 2 + 1
        if w % 2 == 0:
            ans = (2 * tate - 1) * (w // 2)
        else:
            ans = (2 * tate - 1) * (w // 2) + tate
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(int(h/2*w))
elif h % 2 == 0 and w % 2 != 0:
    print(int(h/2*w))
elif h % 2 != 0 and w % 2 == 0:
    print(int(h*w/2))
else:
    print(int((h*w+1)/2))

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

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

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(' '))
print(int(h * w / 2) + 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)
else: 
    m, a = divmod(h, 4)
    n, b = divmod(w, 4)
    print(8*m*n + 2*a*n + 2*m*b + int((a*b+1)/2))

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

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

Solution (Python):
H,W = map(int,input().split()) 
import math
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(H*((W-1)//2)+(H+1)//2)

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

Solution (Python):
A,B=map(int, input().split())
C=A*B//2
D=A*B%2
if A==1 or B==1:
  E=1
else:
  E=C+D
print(E)

Solution (Python):
import math
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(math.ceil(H*W/2))

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


def main():
    h,w = mi()

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

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

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

    b=H//2

    N=a*b*2+W%2*b+H%2*a

    if H%2==1 and W%2==1:
        N+=1
    print(N)

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

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

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

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

Solution (Python):
import math

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

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

ans = (H // 2) * W

if H % 2 == 1:
    ans += math.ceil(W / 2)

print(ans)

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

Z = H * W % 2

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

Solution (Python):

H , W = input().split()
W = int(W)
H = int(H)
ans = int(0)





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

Solution (Python):
a = [int(x) for x in input().split(" ")]
if a[0] < 2 or a[1] < 2:
    print(1)
    exit()
kisu = a[0] // 2 if a[0] % 2 == 0 else a[0] // 2 + 1
gusu = a[0] // 2
yokokisu = a[1] // 2 if a[1] % 2 == 0 else a[1] // 2 + 1
yokogusu = a[1] // 2
ans = kisu * yokokisu + gusu * yokogusu
print(ans)

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

Solution (Python):


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

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

if h == 1:
    a = 1
if w == 1:
    a = 1

print(a)

Solution (Python):
Y, X = map(int, input().split()) 	

num = X * Y
if X == 1 or Y == 1:
  out =1
elif num % 2 == 0:
  out = int(num / 2)
elif num % 2 == 1:
  out = int((num -1)/2 + 1)
print(out)

Solution (Python):
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H,W = IL()
if H == 1 or W == 1:
  print(1)
else:

  numb = W//2
  numa = W - numb

  numd = H//2
  numc = H - numd
  ans = numa * numc + numb * numd

  print(ans)

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

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

a=w*(h//2)

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

Solution (Python):
value = input().split()
rows = int(value[0])
colmuns = int(value[1])


if colmuns == 1:
  rows = 1
elif rows == 1:
  colmuns = 1

OddColNum = colmuns // 2 
EvenColNum = OddColNum
if (colmuns % 2) != 0:
  OddColNum = OddColNum + 1
if (colmuns == 1):
  OddColNum = 1

OddRowCount = 0
EvenRowCount = rows // 2
if (rows % 2) == 0:
  OddRowCount = rows // 2
else:
  OddRowCount = (rows // 2) + 1
if (rows == 1):
  OddRowCount = 1

counts = OddRowCount * OddColNum + EvenColNum * EvenRowCount
print(counts)

Solution (Python):
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *
INF = 500000
mod = 10**9+7

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

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

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

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

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

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

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

if hw[0] == 1 or hw[1] == 1:
    count = 1
elif hw[0] % 2 == 0 and hw[1] % 2 == 0:
    count = (hw[0] * hw[1]) // 2
elif hw[0] % 2 != 0 and hw[1] % 2 == 0:
    count = ((hw[0] + 1) * hw[1] // 2) - (hw[1] // 2)
elif hw[0] % 2 == 0 and hw[1] % 2 != 0:
    count = ((hw[1] + 1) * hw[0] // 2) - (hw[0] // 2)
else:
    count = ((hw[0] + 1) * (hw[1] + 1) // 2) - ((hw[0] // 2 + 1) + (hw[1] // 2 + 1) - 1)
print(count)

Solution (Python):
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
 
if Line[0] ==1 or Line[1] == 1:
  print("1")
else:
  print(-(-Line[0]*Line[1] // 2))

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

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

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

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


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


if __name__ == '__main__':
    solve()

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

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

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

print(ans)

Solution (Python):

def main():
    temp = list(map(int,input().split(' ')))
    H = temp[0]
    W = temp[1]

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

    
    
    
    
    
    
    
    
    
    
    
    
    

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

    

if __name__ == '__main__':
    main()

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

Solution (Python):
H, W = map(int, input().split())
if H == 1 or W == 1:
  total = 1
else:
  Rodd = (W + 2 - 1) // 2
  Reven = W - Rodd
  odd = (H + 2 - 1) // 2
  even = H - odd
  total = Rodd * odd + Reven * even

print(total)

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

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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
w, h = input().split()
w = float(w)
h = float(h)
n = (w // 2 + w % 2)*(h // 2 + h % 2)
m = w // 2 * (h //2)

if (n and m):
	print(int(n + m))
else:
  	print(1)

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

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

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

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

else:
    print(ans)

Solution (Python):
import math
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()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

H,W = nm()
if H == 1: 
    print(1)
    exit(0)
if W == 1:
    print(1)
    exit(0)
    
print((H * W + 1)//2)

Solution (Python):



import sys, math

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    H, W = i2nn()
    if H == 1 or W == 1:
        print(1)
        return
    print(math.ceil(H * W / 2))
    return

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 + 1) * (W + 1) // 4 + (H - 1) * (W - 1) // 4)

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

print(res)

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

ans = 0

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

print(ans)

Solution (Python):
from math import ceil

H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    exit()
even = ceil(H/2)
odd = H-even
ans = H*(W//2) + even*(W%2)

print(max(ans, 1))

Solution (Python):
a,b = map(int, input().split())
m = (a+1) //2
n = a // 2
c = (b+1) // 2
d = b // 2
x = (m*c)+(n*d)
if a == 1:
  x = 1
elif b == 1:
  x = 1
print(x)

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

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

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

ws = -1
wss = -1

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

if (w % 2) == 0:
    ws = w//2
else:
    ws = (w + 1)//2

wss = w//2

hs = -1
hss = -1

if (h % 2) == 0:
    hs = h//2
else:
    hs = (h+1)//2

hss = h//2



print(ws*hs + wss*hss)

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

ans = 0

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

print(ans)

Solution (Python):
def solve():
    N, M = map(int, input().split())
    if N == 1:
        return 1
    if M == 1:
        return 1
    
    if N % 2 == 0:
        return M * N // 2
    else:
        a = N // 2 * M
        if M % 2 == 0:
            return a + M//2
        else:
            return a + (M//2 + 1)

print(solve())

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

        

    result = (H * W) // 2

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

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

height, width = [int(i) for i in input().split(' ')]

if height > 1 and width > 2:
    print(math.ceil(width/2) * math.ceil(height/2) + math.floor(width/2) * math.floor(height/2))
else:
    print(1)

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

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

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

if H % 2 != 0 and W % 2 == 0:
    H, W = W, H

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

Solution (Python):

import math


def main():

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

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

    print(int(result))


if __name__ == '__main__':
    main()

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

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

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

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

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

print(ans)

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

Solution (Python):



from math import *
from copy import *
from string import *				
from random import *				
from bisect import *				
from sys import stdin				
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(l):
	n = len(l)

h,w = list(map(int, stdin.readline().rstrip().split()))
if(h == 1 or w == 1):
	print(1)
else:
	print(ceil((h/2)*w))

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

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

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

Solution (Python):
import math
import copy
from copy import deepcopy
import sys
import fractions

from functools import reduce

import heapq
import collections
import itertools
sys.setrecursionlimit(100001)






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


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

    return outputData


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

    return outputDataList


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

    return outputDataList






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

ans = 0
ans += w * math.floor(h / 2)

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

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

print(int(ans))

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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()
if H == 1 or W == 1:
    print(1)
    exit()
if H % 2 == 0 and W % 2 == 0:
    a = H * W // 2
if H % 2 == 0 and W % 2 != 0:
    a = H * W // 2
if H % 2 != 0 and W % 2 == 0:
    a = (H - 1) * W // 2 + (W // 2)
if H % 2 != 0 and W % 2 != 0:
    a = (H - 1) * W // 2 + (W // 2 + 1)
print(a)

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

if H * W %2 != 0:
    ans += 1

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

print(str(ans))

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

h = int(s[0])
w = int(s[1])
if w == 1 or h == 1:
    print(1)
else: 
	r = (h*w+1) /2 if h %2 !=0 and w %2 !=0 else h*w/2
	print(int(r))

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

if (H==1 or W==1) :
    print(1)
else:
    m1=int((W+1)/2)
    m2=int(W/2)

    n1=int((H+1)/2)
    n2=int(H/2)

    print(m1*n1+m2*n2)

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):
x = input().split()
H = int(x[0])
W = int(x[1])

n = H % 2
m = W % 2

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

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


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

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