Problem:
 Score : 200 points    Problem Statement We have a board with H horizontal rows and W vertical columns of squares.
There is a bishop at the top-left square on this board.
How many squares can this bishop reach by zero or more movements?  Here the bishop can only move diagonally.
More formally, the bishop can move from the square at the r_1 -th row (from the top) and the c_1 -th column (from the left) to the square at the r_2 -th row and the c_2 -th column if and only if exactly one of the following holds:   r_1 + c_1 = r_2 + c_2  r_1 - c_1 = r_2 - c_2   For example, in the following figure, the bishop can move to any of the red squares in one move:       Constraints  1 \leq H, W \leq 10^9  All values in input are integers.         Input Input is given from Standard Input in the following format:  H \ W       Output Print the number of squares the bishop can reach.        Sample Input 1 4 5      Sample Output 1 10  The bishop can reach the cyan squares in the following figure:        Sample Input 2 7 3      Sample Output 2 11  The bishop can reach the cyan squares in the following figure:        Sample Input 3 1000000000 1000000000      Sample Output 3 500000000000000000

Solution (Python):
import sys

import math

input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
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 [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  a=(w+1)//2
  b=w//2

  if h==1:
    return 1

  if w==1:
    return 1

  if h%2==0:
    return h//2*a+h//2*b
  return (h+1)//2*a+h//2*b


print(main())

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

cnt = 0
if h > 1 and w > 1:
    cnt += ((w+1)//2)*(h//2)
    cnt += (w//2)*(h//2)
    if h&1 == 1:
        cnt += (w+1)//2
else:
    cnt = 1

print(cnt)

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

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

if (num[0] == 1) or (num[1] == 1):
  ans = 1
else:
  w_1 = int((num[1]+1)/2)
  w_2 = int(num[1]/2)

  h_1 = int((num[0]+1)/2)
  h_2 = num[0] - h_1

  ans = h_1*w_1 + h_2*w_2

print(ans)

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

if(H==1):
  print("1")
elif(W==1):
  print("1")
else:
  r = H * W // 2
  s = H * W % 2
  print(r+s)

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

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

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

if w == 1 or h == 1:
  print('1')
  sys.exit()

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

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

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

    print(ans)



if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

H = int(H)
W = int(W)

t = H * W

mod = t % 2

if H != 1 and W != 1:
    if mod == 0:
        print(int(t/2))
    else:
        print(int(t/2) + 1)
else:
    print(1)

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

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

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

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

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

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

print(ans)

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

ans = 0

ans += floor(h / 2) * floor(w / 2)
ans += ceil(h / 2) * ceil(w / 2)

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

print(ans)

Solution (Python):
nums =input().rstrip().split(" ")
tate=int(nums[0])
yoko=int(nums[1])
if tate==1 or yoko==1:
    masu=1
elif yoko%2==0:
    masu=int(yoko/2)*tate
elif yoko%2==1:
    masu=yoko*int(tate/2)+(tate%2)*int((yoko+1)/2)
print(masu)

Solution (Python):
import math

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

Solution (Python):
d = input().split(" ")
h = int(d[0])
w = int(d[1])
if h == 1 or w == 1:
	p = 1
elif h % 2 == 1 and w % 2 == 1:
	p = int(h * w / 2) + 1
else:
	p = int(h * w / 2)
print(p)

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

Solution (Python):








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

resolve()

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

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

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

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

Solution (Python):
import sys
stdin = sys.stdin
from itertools import accumulate, groupby
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))


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

Solution (Python):

import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

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


    

if __name__ == '__main__':
    main()

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

h,w = mi()

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

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

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

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

mul = h * w

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

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

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

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

Solution (Python):
H, W = map(int, input().split())
l = (W+1)//2
m = W//2

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

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

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

    W_odd = int(W / 2)
    W_even = W - W_odd

    H_odd = int(H / 2)
    H_even = H - H_odd

    sum_number = (W_odd * H_odd + W_even * H_even)

    print(sum_number)

if __name__ == "__main__":
    resolve()

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

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

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

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

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

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

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


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

if W % 2 == 0:
    kisu = W // 2
    gusu = W // 2
else:
    kisu = W // 2 + 1
    gusu = W // 2

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

print(ans)

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

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

H,W = input_int()

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

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

Solution (Python):

import sys


def solve(H: int, W: int):
    if H == 1 or W == 1:
        print(1)
        exit()

    hguu = H if H % 2 == 0 else H - 1
    wguu = W if W % 2 == 0 else W - 1
    res = hguu * wguu // 2

    if H % 2 == 1:
        res += wguu // 2
    if W % 2 == 1:
        res += hguu // 2
    if H % 2 == 1 and W % 2 == 1:
        res += 1

    print(res)

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

import sys
import decimal

def solve(H: int, W: int):
    decimal.getcontext().prec = 30
    if(H==1 or W==1):
        print(1)
        return
    if(H*W%2==0):
        print(decimal.Decimal(H*W/2))
    else:
        print(decimal.Decimal(H*W//2+1))
    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 submit():
    h, w = map(int, input().split())

    if h == 1 or w == 1:
        print(1)
        return
    
    even_c = sum(divmod(w, 2))
    odd_c = w // 2
    even_row = sum(divmod(h, 2)) * even_c
    odd_row = (h // 2) * odd_c

    print(even_row + odd_row)


if __name__ == "__main__":
    submit()

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

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

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

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

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


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

Solution (Python):


import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

H, W = MAP()

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

ans = ceil(H*W, 2)
print(ans)

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

big=math.ceil(W/2)
sml=math.floor(W/2)

ans=big*math.ceil(H/2)+sml*math.floor(H/2)

if H !=1 and W!=1:
    print(int(ans))
else:
    print(1)

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

c = (a + 1) // 2
d = a // 2

e = (c + d) * (b // 2)

if a == 1 or b == 1:
    print(1)
else:
    print(e if b % 2 == 0 else e + c)

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

x = h//2 if h%2==0 else h//2+1
y = w//2 if w%2==0 else w//2+1

print(1 if h==1 or w==1 else x*y+(h-x)*(w-y))

Solution (Python):
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import ceil
def I(): return int(input())
def MI(): return map(int, input().split())

def main():
    H, W = MI()
    if H==1 or W==1:
        print(1)
    else:
        print(ceil(H*W/2))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

Solution (Python):



import math
H, W = list(map(int, input().split()))
 
ans = math.ceil(W/2) * (math.ceil(H/2))
ans += (W // 2) * (H//2)

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

Solution (Python):
import math

def main():
    H,K = map(int, input().split())
    if H==1 or K ==1:
        print(1)
        return
    elif H%2==0 or K%2==0:
        print(int(H*K/2))
        return
    else:
        print(int(math.ceil(H*K/2)))
        return
        

main()

Solution (Python):
import math
s = input().split(' ')
h = int(s[0])
w = int(s[1])
w1 = math.ceil(w/2)
w2 = math.trunc(w/2)
h1 = math.ceil(h/2)

if h == 1:
    print(1)
elif w == 1:
    print(1)
else:
    print(h1*w1 + (h-h1)*w2)

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

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

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

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

print(ans)

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

Solution (Python):
import math

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

odd = math.ceil(H/2)
even = math.floor(H/2)

X = odd * math.ceil(W/2) + even * math.floor(W/2)

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

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

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

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

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

print(ans)

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


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

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

Solution (Python):
import math

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

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

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

Solution (Python):


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

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

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

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

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

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

Solution (Python):
import math

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

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

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

a = (w+1)//2

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

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    H, W = iim()
    ha, hb = divmod(H, 2)

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

    ans = ha * W
    if hb:
        ans += W // 2
        if W & 1:
            ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()

Solution (Python):




import sys
input = sys.stdin.readline



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

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

    res = H * W

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

    res //= 2

    print(res)



main()

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

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

    ans = 0
    ans += ((W + 1) // 2) * ((H + 1) // 2)
    ans += (W // 2) * (H // 2)
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):

import math

input_num = input().split(" ")
H = int(input_num[0])
W = int(input_num[1])

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

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

if __name__ == '__main__':
    main()

Solution (Python):
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys








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

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

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


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

Solution (Python):
import math

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

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

a1 = math.floor(h / 2)
a2 = math.ceil(h / 2)
b1 = math.floor(w / 2)
b2 = math.ceil(w / 2)


print((a1 * b1) + (a2 * b2))

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

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

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

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

if H == 1 or W == 1:
  print(1)
  exit()
  
n1 = math.ceil(W/2)
n2 = math.floor(W/2)
m1 = math.ceil(H/2)
m2 = math.floor(H/2)

ret = m1 * n1 + m2 * n2
print(ret)

Solution (Python):
(a, b) = list(map(int, input().split()))
i= a//2
p = i* b
j = 0
if a % 2 == 1:
  j = (b+1) // 2 

p += j
if a == 1 or b == 1:
  p = 1
print(p)

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

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

    ans = H * W

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

if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        
        
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (h, w) = [int(e) for e in lines[0].split(" ")]

    return (h, w)


def solve(h, w):

    if h == 1 or w == 1:
        return 1

    cell = h * w
    tmp = cell // 2
    result = None
    if cell % 2 == 0:
        result = tmp
    else:
        result = tmp + 1
        

    return result
    


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

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

Solution (Python):
def main():
    h, w = [int(x) for x in input().split()]
    n1 = w//2 + (w&1)
    n2 = w//2

    if h == 1 or w == 1:
        print(1)
    else:
        ans = (n1+n2)*(h//2)
        if h&1:
            ans += n1
        print(ans)


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

Solution (Python):
import math

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

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

print(result)

Solution (Python):
import numpy as np
import math as m

def main(**kwargs):
    if h == 1 or w == 1:
        res = 1
    elif h % 2 == 1 and w % 2 == 1:
        res = (h * w + 1) // 2
    else:
        res = h * w // 2

    return res

if __name__ == "__main__":
    cin = np.array(input().split(" ")).astype("int")
    h, w, *_ = cin

    cout = main(h=h, w=w)
    print(cout)

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

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

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

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

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

Solution (Python):

import sys


def solve(H: int, W: int):
    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:
        print((W+1)//2*H - (H+1)//2 + 1)

    return



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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
H, W = map(int, input().split())
w = W//2
h = H//2
lh = H - h
lw = W- w

if H < 2 or W < 2:
    print(1)
else:
    print(lh * lw + w * h)

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

Solution (Python):

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

if h==1 or w==1:
    print(1)
    import sys
    sys.exit()

r_odd = w//2 + w%2
r_even = w//2

r_odd_cnt = h//2 + h%2
r_even_cnt = h//2

print(r_odd * r_odd_cnt + r_even * r_even_cnt)