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

Solution (Python):
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''

gi = lambda : list(map(int,input().split()))
n, m = gi()
l = m // 2 + m % 2
ans = l * (n // 2 + n % 2) + (m // 2) * (n // 2)
if n == 1 or m == 1:
	ans = 1
print(ans)

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

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

print(ans)

Solution (Python):

def calc(w, h):
    if w == 1 or h == 1:
        return 1

    result = w * h / 2

    if w * h % 2 != 0:
        result += 1

    return int(result)


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

result = calc(w, h)
print(result)

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

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

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

print(ans)

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

if H!=1 and W!=1:
    
    if W%2==0:
        A_W=int(W/2)
        B_W=int(W/2)
    
        if H%2==0:
            A_H=int(H/2)
            B_H=int(H/2)
        else:
            A_H=int(H/2)+1
            B_H=int(H/2)
        
        ans=A_W*A_H+B_W*B_H
    
    else:
        A_W=int(W/2)+1
        B_W=int(W/2)
    
        if H%2==0:
            A_H=int(H/2)
            B_H=int(H/2)
        else:
            A_H=int(H/2)+1
            B_H=int(H/2)
        
        ans=A_W*A_H+B_W*B_H

else:
    ans=1
    
print(int(ans))

Solution (Python):
H, W = list(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):
W, H = map(int, input().split( ))
if W ==1 or H ==1:
    ans = 1
    print(ans)

elif W % 2 ==0 or H % 2 ==0:
    print(int(0.5*W*H))

elif W % 2 !=0 and H %2 !=0:
    print(int(0.5*(W*H+1)))

Solution (Python):









import os


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

Solution (Python):

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

Solution (Python):
from sys import stdin


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

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


main()

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


mm1 = (W+1)//2
mm2 = W//2

mm3 = (H+1)//2
mm4 = H//2

if H>=2 and W>=2:
    print(mm1*mm3+mm2*mm4)
else:
    print(1)

Solution (Python):

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

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

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

Solution (Python):


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

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

Solution (Python):
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

h,w = miinps()
ans = 0
k = w%2
l = w//2
p = h//2
q = h%2

if h == 1:
  print(1)
  exit()
if w == 1:
  print(1)
  exit()
if k == 1:
  ans += (h*l)
  if q == 1:
    ans += (p+1)
  else:
    ans += p
else:
  ans += (h*l)

print(ans)

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

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

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

ans = 0

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

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

print(ans)

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

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

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

print(ans)

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

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

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

res = 0
res += W * (H // 2)

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

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

print(res)

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

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

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

Solution (Python):

 
import math
import itertools
import sys
import copy

 







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

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

Solution (Python):

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

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

print(s)

Solution (Python):
import math
a=input().split(' ')
if(int(a[0])==1):
    print(1)
else:
    if(int(a[1])==1):
        print(1)
    else:
        print(math.ceil(int(a[0])*int(a[1])/2))

Solution (Python):
base = input().split()
h = int(base[0])
w = int(base[1])
if h%2==1:
    ha = (h//2)+1
    hb = ha-1
else:
    ha = h/2
    hb = ha
g = w//2
if w%2==1:
    ans = ha*(g+1)+hb*g
else:
    ans = (ha+hb)*(w/2)
if h ==1:
    ans = 1
if w ==1:
    ans = 1
print(int(ans))

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

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

Solution (Python):
import sys
input=sys.stdin.readline
from math import *
n,m=map(int,input().split())
if n==1 or m==1:
    print(1)
else:    
    print(int(ceil((n*m)/2)))

Solution (Python):
num = [int(i) for i in input().split(' ')]

if num[0] == 1 and num[1] == 1:
  print(1)
elif num[0] == 1 or num[1] == 1:
  print(1)
else:
  A = num[0] * num[1]
  if(A % 2 == 0):
    print(int(num[0] * num[1] / 2))
  else:
    print(int((A-1) / 2 + 1))

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

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

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

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

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

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

x = h*w

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

if x%2==0:
  print(int(x/2))
else:
  print(int(math.ceil(x/2)))

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

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

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

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

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

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

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

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


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

print(ans)

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

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

Solution (Python):
import sys
import re

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

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

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

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

print(out)
sys.stdout.flush()

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


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

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

if H == 1 or W == 1:
    print(1)
else:
    H2 = H // 2
    W2 = W // 2
    H3 = H - H2
    W3 = W - W2
    print(H2 * W2 + H3 * W3)

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

Solution (Python):
hei,wid=map(int,input().split())
s=0
s+=hei*wid

if (hei==1 and wid>=1) or (hei>=1 and wid==1):
    print(1)
elif s%2!=0:
    print(s//2+1)
else:
    print(s//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 + 1) // 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:
    ans = 1
elif h%2 == 0:
    ans = h//2 * w

    
else:
    w1 = w//2
    w2 = w-w1
    ans = ((h//2)*w1) + (((h+1)//2)*(w2))
    
print(ans)

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

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

print(ans)

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

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

Solution (Python):
import math
hw=list(map(int, input().split())) 
h=hw[0]
w=hw[1]
answer=int(math.ceil((h/2)*w))
if(h==1 or w==1):
    answer=1
print(answer)

Solution (Python):
H,W = list(map(int , input().split()))
h = H % 2
w = W % 2
if H > 1 and W > 1:
    if h == 1:
        s = (H+1) /2
        t = s - 1
        if w == 1:
            m = (W+1) /2
            n = m - 1
            a = s * m
            b = t * n
            c = round(a + b)
        else:
            m = W / 2
            a = s * m
            b = t * m
            c = round(a + b)
    else:
        s = H / 2
        a = s * W
        c = round(a)
else:
    c = 1
    
    
print(c)

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

if H==1:
    ans=1
elif W==1:
    ans=1
elif H==2 and W==2:
    ans=2
print(ans)

Solution (Python):

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

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

print(ans)

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

if h == 1 or w == 1:
    num2 = 1
else:
    h2 = h // 2
    row = (w+1) // 2
     
    num2 = h2 * w
    if h % 2 == 1:
        num2 += row
 
print(num2)

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

Solution (Python):


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

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

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

a = ceil(w/2)
b = w - a

if h == 1 or w == 1:
    print(1)
    exit()
    
if h%2 == 0:
    ans = a*h//2 + b*h//2
    print(ans)

else:
    ans = a*(h//2) + b*(h//2) + a
    print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

if H > 1 and W > 1:
    if H % 2 == 0:
        result = W * (H // 2)
    else:
        if W % 2 == 0:
            result = W * (H // 2) + (W // 2)
        else:
            result = W * (H // 2) + (W // 2) + 1
else:
    result = 1

print(result)

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




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


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


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



if h % 2 != 0:
    odd_column = (h//2 + 1) * (w//2 + 1)
    even_column = (h//2) * (w//2)
    res = odd_column + even_column

print(int(res))

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

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

from math import ceil
h_odd_num = ceil(h / 2)
h_even_num = h // 2

w_odd_num = ceil(w / 2)
w_even_num = w // 2

if h > 1 and w > 1:
  print(h_odd_num * w_odd_num + h_even_num * w_even_num)
else:
  print(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):
H,W = map(int,input().split())
ans = 0
if H == 1 or W == 1:
    print(1)
    exit()
if H%2 == 0 and W%2 == 0:
    ans = H*W//2
elif H%2 == 0 and W%2 == 1:
    ans = H*W//2
elif H%2 ==1 and W%2 == 0:
    ans = H*W//2
else:
    ans = H*W//2 + 1
print(ans)

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

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

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

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

print(odd+even)

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

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

Solution (Python):
import sys
W, R = map(int,input().split())
 
seki = W*R

if(W==1 or R==1):
  print(1)
  sys.exit()
 
if seki%2 == 0:
  print(int(seki/2))
else:
  print(int((seki+1)/2))

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

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
H,W = map(int,input().split(' '))
A = -(-W//2)
if W==1 or H==1:
    print(1)
    exit()
if H%2==0:
    print(W*H//2)
else:
    print(W*(H-1)//2+A)

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

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

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


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

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

if h == 1 or w == 1:
    print(1)
else:
    print(-(-(h * w) >> 1))

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

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

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

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

print(int(ans))

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

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

if h % 2 == 1:
    ans += w // 2 + (w % 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(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")
    exit()

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

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

i = h * w

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

if(i % 2 == 0):
    ans = i//2

elif (i % 2 == 1):
    ans = i//2 + 1

print(ans)

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

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

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

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

print(ans)

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

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

Solution (Python):
H,W=(int(x) for x in 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 and w!= 1:
  print(int(h*w/2) + w*h%2)
else:
  print(1)

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

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

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

x = H * W

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

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):
def resolve():
    a, b = map(int, input().split())
    if a ==1 or b==1:
        print(1)
        exit()
    print((a*b+1)//2)
resolve()

Solution (Python):
import math

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

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

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

Solution (Python):
import math
h, w = map(int,input().split())
if w == 1 or h == 1:
    print(1)
    quit()
if h % 2 != 0:
    ans = w * (h-1) / 2 + math.ceil(w / 2)
    print(int(ans))
else:
    ans = w * h / 2
    print(int(ans))

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

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


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

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

Solution (Python):


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

Solution (Python):
import math

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

Solution (Python):
def main():
    h, w = map(int, input().split())
    ans = 0
    if h == 1 or w == 1:
        print(1)
        exit()
    
    if h % 2 == 0:
        ans = h * w // 2
    else:
        if w % 2 == 0:
            ans = h * w // 2
        else:
            ans = h * 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):
import sys, re
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,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

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

def main():
	h, w = MAP()
	if h > 1 and w > 1:
		print(ceil((h * w) / 2))
	else:
		print(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//2 + H*W%2)

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

panels = W * H

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

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

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    H, W = lr()
    a = H*W
    if H == 1 or W == 1:
        print(1)
    elif a%2 == 1:
        print((a+1)//2)
    else:
        print(a//2)
    return
resolve()

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

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

Solution (Python):
import sys

input = sys.stdin.readline

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

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

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

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

q = h * w // 2
r = h * w % 2

if h == 1 or w == 1:
    print("1")
else:
    print(q + r)

Solution (Python):


from math import ceil
import sys
[H, W] = map(int, input().split())

if H <= 1:
    print(1)
    sys.exit(0)

if W <= 1:
    print(1)
    sys.exit(0)


print(ceil(H * W / 2))

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


H, W = MI()

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

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

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