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



Sample input:
4 5


Sample output:
10

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

# a/bの切り上げ: (a + b - 1)//b
print(((h * w) + 2 - 1) // 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split()
b = int(a[0]) // 2
c = int(a[0]) % 2
if int(a[0]) == 1 or int(a[1]) == 1:
  print("1")
elif c == 0:
  print(int(int(b) * int(a[1])))
else:
  if int(a[1]) % 2 == 1:
    print(int(int(b) * int(a[1]) + int(a[1]) // 2 + 1))
  else:
    print(int(int(b) * int(a[1]) + int(a[1]) // 2))

Submission status: Accepted

Solution code:
import math
a,b = map(int,input().split())
if a == 1 or b == 1 :
    print(1)
    exit()
d = (int)((a*b+1)/2)
print(d)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    if w==1 or h==1:
        print(1)
        return
    ans = 0
    ans += math.ceil(w/2)*math.ceil(h/2)
    ans += (w//2)*(h//2)
    print(ans)
    return

if __name__=='__main__':
    h,w = IL()
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h, w = map(int, input().split())
hd, hm, wd, wm = h // 2, h % 2, w // 2, w % 2
s = hd * wd * 2  + hm * wd + wm * hd + hm * wm
if h == 1 or w == 1:
    s = 1
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
A = list(map(int, input().split()))
H = A[0]
W = A[1]

first = math.ceil(H/2)
second = math.floor(H/2)
if H>= 2 and W>=2:
  ans = math.ceil(W/2)*first + math.floor(W/2)*second
elif W==1:
  ans = 1
elif H==1:
  ans = 1
  
print(ans)

Submission status: Accepted

Solution code:
import math
def man(h, w):
    if h == 1 or w == 1:
        return 1
    else:
        return math.ceil(h * W / 2)
H, W = map(int,input().split())
print(man(H, W))

Submission status: Accepted

Solution code:
def bishop(n, m):
	if n == 1 or m == 1:
		return 1
	if n % 2 == 0:
		return (n // 2) * m
	else:
		return (((n // 2)+1) * m) - (m // 2)
n, m = map(int, input().split())
print(bishop(n, m))

Submission status: Accepted

Solution code:
import math


def resolve():
    import sys
    input = sys.stdin.readline
    row1 = [int(x) for x in input().rstrip().split(" ")]
    h = row1[0]
    w = row1[1]

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

    ans = (h-(h%2))*(w-(w%2))/2
    ans += (h%2)*(w-(w%2))/2
    ans += (w%2)*(h-(h%2))/2
    ans += (w%2)*(h%2)

    print(int(ans))


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#B - Bishop △(TLE,WA)
H,W = map(int,input().split())

count = 0
if H == 1 or W == 1:#コーナーケース(H,Wが1の時どこにも動けない)
    count = 1
elif H % 2 == 0:
    count = (H // 2)*W
else :
    count = (H // 2)*W + ((W + 2 - 1) // 2)#x/yの切り上げ:(x+y-1)//y
print(count)

Submission status: Accepted

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

H_ = H % 2
W_ = W % 2

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

elif H_ == 0:
    print(str(round(H/2*W//1)))

elif H_ == 1:
    h = H // 2 + 1
    h_ = H // 2
    if W_ == 0:
        print(str(round((h + h_)*W/2)))

    elif W_ == 1:
        w = W // 2+1
        w_ = W // 2
        print(str(round(h * w + h_ * w_)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

Solution code:
import math
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(math.ceil((h*w)/2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


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

Submission status: Accepted

Solution code:
H,W = [int(n) for n in input().split()]
if H < 2:
  W = 1
if W < 2:
  H = 1
print((H*W//2) if H*W%2==0 else ((H*W+1)//2))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

# from numba import njit

# from collections import Counter
# from itertools import accumulate
# import numpy as np
# from heapq import heappop,heappush
# from bisect import bisect_left

# @njit
def solve(n,m):
  if n == 1 or m == 1:
    return 1
  else:
    return (n*m + 1)// 2



def main():
  N,M = map(int,input().split())
  # a = list(map(int,input().split()))
  print(solve(N,M))
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W = map(int,input().split())
P = H*W

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

elif P%2 == 0:
  print(int(P/2))
else:
  print(int(P/2)+1)

Submission status: Accepted

Solution code:
H,W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
else:
    div,mod = divmod(H*W,2)
    print(div+mod)

Submission status: Accepted

Solution code:
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:
    a=int(H*W/2)
    print(a+1)

Submission status: Accepted

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

    if H == 1 or W == 1:
        print(1)
        
    else:
        L1 = 0
        L2 = 0

        L1 = L2 = W // 2

        if W % 2 == 1:
            L1 += 1

        ans = (L1 + L2) * (H//2)

        if H % 2 == 1:
            ans += L1

        print(ans) 

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[h,w] = [int(i) for i in 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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

H,W = MI()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for _ in range(M)]

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

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

print(ceil(H/2)*ceil(W/2) + floor(H/2)*floor(W/2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

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

res = math.ceil((H*W)/2)
print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

H,W = [int(x) for x in 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 - 1) * W // 2 + (W + 1) //2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(math.ceil(h*w/2))

Submission status: Accepted

Solution code:
h, w = [int(i) for i in input().split()]

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(int(ans))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
h, w = map(int, input().split())

cnt = 0

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

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

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

l = list(map(int, input().split()))
a = l[0]
b = l[1]

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

else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
    h,w = map(int, input().split())
    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))
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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+(H/2+1)))

Submission status: Accepted

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

ans = 0
x = H * W

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

seki = H * W

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

Submission status: Accepted

Solution code:
#6
import sys
H,W = map(int,input().split())
k = H*W

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
a,b=map(int,input().split(' '))

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

def main():

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
H, W = list(map(int, input().split()))
if H == 1 or W == 1:
    print('1')
    sys.exit()
a = (W + 1) // 2
res = W * (H // 2) + (H % 2) * a
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

a = H * W

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

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

Submission status: Accepted

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

out = 0
if min(h, w) == 1:
    out = 1
else:
    out += (h // 2) * 2 * (w // 2) * 2 / 2 + (h % 2) * math.ceil(w / 2) + (w % 2) * math.ceil(h / 2) - (h % 2) * (w % 2)
print(int(out))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    H, W = [int(item) for item in input().split()]

    if H == 1 or W == 1:
        res = 1
    elif H % 2 == 1 and W % 2 == 1:
        res = H * W // 2 +1
    else:
        res = H * W // 2

    print(res)
if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    H, W = map(int, input().split())
    if H == 1 or W == 1:
        print(1)
        return
    B = W // 2
    A = W - B
    D = H // 2
    C = H - D
    print(C * A + D * B)
main()

Submission status: Accepted

Solution code:
import math
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-1)*w/2+math.ceil(w/2)))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import math

H,W = list(map(int,input().split(" ")))
if W > 1 and H > 1:
    print(math.ceil((H*W)/2))
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

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

# print(-(-H // 2))
# print(-(-W // 2))
# print(H // 2)
# print(W//2)

# print(4 * 2 + 3 * 1)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if H == 1 or W == 1:
    print(1)
else:
    # 一般に、正整数 x, y に対し、x/y を切り上げた値は (x + y − 1)//y 
    # (// は整数除算) として実装できる
    # この場合H*W+2-1
    print((H*W+1)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h, w = map(int, open(0).read().split())

if h == 1 or w == 1:
    print(1)
else:
    print(sum(divmod(h*w, 2)))