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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
import math
if h == 1 or w == 1:
  print(1)
  
elif h%2 == 0 and w%2 == 0:
  print(h * w // 2)
  
else:
  if h%2 == 0:
    we = w//2
    wo = math.ceil(w/2)
    print(we * h//2 + wo * h//2)
  
  else:
    he = h//2
    ho = math.ceil(h/2)
    print(ho * w//2 + he * w//2)

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    if H == 1 and W == 1:
        print(1)
        return

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

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    if H == 1 and W == 1:
        print(1)

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

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    if H == 1 and W == 1:
        print(1)

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

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    if H == 1 and W == 1:
        print(1)

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

    return
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import decimal
from math import ceil
H,W=input().split()
h=decimal.Decimal(H)
w=decimal.Decimal(W)

print(int(ceil(h*w/2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import decimal
H,W=input().split()
h=decimal.Decimal(H)
w=decimal.Decimal(W)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import decimal
H,W=input().split()
h=decimal.Decimal(H)
w=decimal.Decimal(W)

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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
print(round(H*W/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
H,W=map(int,input().split())
print(int(ceil(H*W/2.0)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
if H == 1 and M ==1 :
    print(1)

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

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
if H == 1 and M ==1 :
    print(1)

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

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
if H == 1 and M ==1 :
    print(1)

elif M%2 == 0 :
    print((H*M/2))
else :
    print(round((H*M/2) + (H/2)))

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
if H == 1 and M == 1:
    print(1)
else :
    print(round(H*M/2))

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
print(round(H*M/2))

Submission status: Wrong Answer

Solution code:
H,M = map(int,input().split())
if M%2 == 0 :
    print(int(H*M/2))
else :
    print(int(H*M/2) + round(H/2))

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
cnt=0
for i in range(H):
    for j in range(W):
        if i+j % 2 ==0:
            cnt+=1
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H,M=map(int,input().split())
if H==1 or M==1:
  print("1")

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w=[int(x) for x in input().split()]
s=0
if h%2!=0 and w%2!=0:
  s=(h//2)*(w//2) + (h//2 + 1)*(w//2 +1)
elif h%2==0 and w%2!=0:
  s=(h//2)*(w)
elif h%2!=0 and w%2==0:
  s=(w//2)*h
  
print(int(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    ans = 0
    if (H == 1 and W == 1):
        print(1)
        return

    ans = (H * W) // 2

    print(ans)

    return
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    ans = 0
    if (H == 1 and W == 1):
        print(1)
        return
    if H % 2 == 1:
        even = (H // 2) + 1
    else:
        even = (H // 2)

    odd = H - even

    if W % 2 == 1:
        ans += even * (W // 2 + 1)
    else:
        ans += even * (W // 2)

    ans += odd * (W // 2)

    print(ans)

    return
resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    ans = 0
    if (H == 1 and W == 1):
        print(1)
        return
    if H % 2 == 1:
        even = (H // 2) + 1
    else:
        even = (H // 2)

    odd = H - even

    if W % 2 == 1:
        ans += even * (W // 2 + 1)
    else:
        ans += even * (W // 2)

    ans += odd * (W // 2)

    print(ans)

    return

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = list(map(int, input().split()))
    ans = 0
    if H % 2 == 1:
        even = H // 2 + 1
        odd = H - even
    else:
        even = H // 2
        odd = H - even

    if W % 2 == 1:
        ans += even * (W // 2 + 1)
        ans += odd * (W // 2)
    else:
        ans += even * (W // 2)
        ans += odd * (W // 2)

    print(ans)

    return

resolve()

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
res = int((H+1)/2) * W
if H%2==1:
    res -= int(W/2)
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
res = int((H+1)/2) * W
if W%2==1:
    res -= int(W/2)
print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
(a,b)=[int(x) for x in input().split()]
print((a*b+1)//2)

Submission status: Wrong Answer

Solution code:
(a,b)=[int(x) for x in input().split()]
print((a+b+1)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
print((x*y+1)//2)

Submission status: Wrong Answer

Solution code:
H, W = list(map(int,input().split()))
odd = W // 2 + 1
even = odd - 1
if H % 2 == 0:
  numo = int(H/2)
  nume = numo
else:
  numo = int(H/2)
  nume = numo - 1
print(odd * numo + even * nume)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

H, W = map(int, input().split())
if H < W:
    print((math.ceil(H/2)*math.ceil(W/2))+(math.ceil(H/2)*math.ceil(H/2)))
elif H>W:
    print((math.ceil(H / 2) * math.ceil(W / 2)) + (math.ceil(W / 2) * math.ceil(W / 2)) - 1)
else:
    if H % 2 ==0:
        print((math.ceil(H / 2) * math.ceil(W / 2)) * 2)
    else:
        print((math.ceil(H / 2) * math.ceil(W / 2)) + ((math.ceil(W / 2)-1) * (math.ceil(W / 2)-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
print(H*W//2 + (H*W)%2)

Submission status: Wrong Answer

Solution code:
h, m = map(int, input().split())
count = ((h //2) * m) + ((h %2) *((m //2) + (m %2)))
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
from sys import stdin
H, W = [int(_) for _ in stdin.readline().rstrip().split()]
if H == 1 or W == 1:
    print(0)
else:
    print(ceil(H*W/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
h1 = math.ceil(H/2)
h2 = math.floor(H/2)
w1 = math.ceil(W/2)
w2 = math.floor(W/2)

print(h1*w1+h2*w2)

Submission status: Wrong Answer

Solution code:
# 奇数行目は(W/2)+1. 偶数行目は(W/2)+1
H, W = map(int, input().split())
block_num = H*W

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

Submission status: Wrong Answer

Solution code:
# 奇数行目は(W/2)+1. 偶数行目は(W/2)+1
H, W = map(int, input().split())
block_num = H*W

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

Submission status: Wrong Answer

Solution code:
# 奇数行目は(W/2)+1. 偶数行目は(W/2)+1
H, W = map(int, input().split())
block_num = H*W

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np

H, W = MAP()
print(-(-H*W//2))

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np

H, W = MAP()
print(-(-H*W)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
print([1,sum(divmod(h*w, 2))][h>0<w])

Submission status: Wrong Answer

Solution code:
print(sum(divmod(eval(input().replace(" ", "*")), 2)))

Submission status: Wrong Answer

Solution code:
print(sum(divmod(eval(input().replace(" ","*")),2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[9]:


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


# In[10]:


ans = -(-H*W//2)
print(ans)


# In[ ]:

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
### 片方だけ奇数のマスには行くことができない
### Hが偶数、Wが偶数の場合 → H*W // 2
### Hが奇数、Wが偶数の場合 → H*W // 2 (Wが奇数の場合も同様)
### Hが奇数、Wが奇数の場合 → H*W // 2 + 1
if H % 2 != 0 and W % 2 != 0:
    print(int(H * W // 2 + 1))
else:
    print(int(H * W // 2))

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
### 片方だけ奇数のマスには行くことができない
### Hが偶数、Wが偶数の場合 → H*W // 2
### Hが奇数、Wが偶数の場合 → H*W // 2 (Wが奇数の場合も同様)
### Hが奇数、Wが奇数の場合 → H*W // 2 + 1
if H % 2 != 0 and W % 2 != 0:
    print(H * W // 2 + 1)
else:
    print(H * W // 2)

Submission status: Wrong Answer

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

if(W != 1):
  cnt1 = ((H+1)//2)*((W+1)//2)
  cnt2 = (H//2)*(W//2)
  ans = cnt1 + cnt2
else:
  ans = 1
  
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


H, W = mi()

# 縦偶数
if H % 2 == 0:
    print(H * W // 2)
# 縦奇数 かつ　横偶数
elif W % 2 == 0:
    print(H * W // 2)
# 縦奇数 かつ　横奇数
else:
    print((H * W // 2) + 1)

Submission status: Wrong Answer

Solution code:
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


H, W = mi()

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

Submission status: Wrong Answer

Solution code:
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


H, W = mi()

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

Submission status: Wrong Answer

Solution code:
def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


H, W = mi()

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

Submission status: Wrong Answer

Solution code:
il = [int(k) for k in input().split()]

H = il[0]
W = il[1]
# H : 縦
#  W : 横

import math

a = math.ceil(W/2)
b = math.floor(W/2)
c = math.ceil(H/2)
d = math.floor(H/2)

print(a*c + b*d)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
H,W= LI()

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(H: int, W: int):
    total_cell = W * H
    print(math.ceil(total_cell / 2))
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(H, W)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math


def solve(H: int, W: int):
    row_even_cells = math.floor(W / 2)
    row_odd_cells = math.ceil(W / 2)

    even_row = math.floor(H / 2)
    odd_row = math.ceil(H / 2)

    ans_even = even_row * row_even_cells
    ans_odd = odd_row * row_odd_cells
    print(ans_odd + ans_even)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(H, W)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
h, w=map(int, input().split())
# 偶数と奇数で場合分け
if h%2==0:
  # 1列でh/2個のマスできるからあとは横何個あるかだけ
  print(int(h*w/2))
else:
  set1=h
  if w%2==0:
    print(int(set1*w/2))
  else:
    rm=w//2
    print(int(set1*rm+h//2+1))

Submission status: Wrong Answer

Solution code:
h, w=map(int, input().split())
# 偶数と奇数で場合分け
if h%2==0:
  # 1列でh/2個のマスできるからあとは横何個あるかだけ
  print(int(h*w/2))
else:
  set1=h
  if w%2==0:
    print(int(set1*w/2))
  else:
    rm=w//2
    print(set1*rm+h//2+1)

Submission status: Wrong Answer

Solution code:
h, w=map(int, input().split())
# 偶数と奇数で場合分け
if h%2==0:
  # 1列でh/2個のマスできるからあとは横何個あるかだけ
  print(h*w/2)
else:
  set1=h
  if w%2==0:
    print(set1*w/2)
  else:
    rm=w//2
    print(set1*rm+h//2+1)

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

h, w = map(int, input().split())
print(ceil(h*w/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

h, w = [int(x) for x in stdin.readline().strip().split()]
if(h == 1 or w == 1):
  print(0)
else:
  print((h//2)*(w//2)+((h+1)//2)*((w+1)//2))

Submission status: Wrong Answer

Solution code:
from sys import stdin

h, w = [int(x) for x in stdin.readline().strip().split()]
print((h//2)*(w//2)+((h+1)//2)*((w+1)//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = list(map(int,input().split()))
HE = H//2
HO = H - HE
WE = W//2
WO = W - WE
print(HO*WO+HE*WE)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

w1=0--W//2
w2=W//2

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

Submission status: Wrong Answer

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

w1=0--W//2
w2=W//2

print(w1*(0--H//2)+w2*(H//2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


if int(m/2) == m/2:
    ans = n*m/2
else:
    if int(n/2)==n/2:
        ans = n*m/2
    else:
        ans = (n*m/2)+0.5

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
num = 0
for i in range(W):
    if i%2==0:
        if H%2==0:
            num += H//2
        else:
            num += H//2+1
    else:
        num += H//2
print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
div,mod=divmod(h*w,2)
print(div+mod)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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