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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

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

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

H, W = MAP()


print(ceil(H * W / 2))

exit()
if W % 2 == 0:
    a = W // 2
    b = W // 2
else:
    a = W // 2 + 1
    b = W // 2
# a = ceil(W / 2)
# b = ceil((W-1) / 2)
print(a)
print(b)
if H % 2 == 0:
    ans = a * H // 2 + b * H // 2
    print(H//2)
    print(H//2)
else:
    ans = a * (H // 2+1) + b * H // 2
    print(H//2+1)
    print(H//2)
print(ans)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

N = [int(_) for _ in input().split()]

H, W = N[0], N[1]


def solve(H, W):
    if H == 0 or W == 0:
        return 0
    
    acnt = int(W / 2) + 1
    bcnt = W - (int(W / 2) + 1)
    
    if H % 2 == 0:
        cnt = acnt * int(H/2) + bcnt * int(H/2)
    else:
        cnt = acnt * (int(H/2) + 1) + bcnt * int(H/2)
    return cnt

print(solve(H, W))

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

Submission status: Wrong Answer

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

ch =math.ceil(h/2)
if h % 2 == 1:
  ch1 = math.ceil(h/2)
  ch2 = ch1 - 1 
else:
  ch1 = math.ceil(h/2)
  ch2 = ch1
  
if w % 2 == 1:
    ans = ch1 * math.ceil(w / 2) + ch2 *  math.floor(w / 2)
else:
    ans = ch1 * (w / 2) + ch2 * (w / 2)
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

resolve()

Submission status: Wrong Answer

Solution code:
from math import ceil
l = [int(j) for j in input().split()]
print(ceil(l[0]*l[1]/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(A)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

s = h * w

if s % 2:
    print(s//2+1)
else:
    print(s/2)

Submission status: Wrong Answer

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

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(str(int((h * w -1) / 2 + 1))))

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split( )))
H = a[0]
W = a[1]
b = H//2
c = H//2
if H%2 == 1:
  b = b+1

d = W//2
answer = (b+c)*d
if W%2 == 1:
  answer = answer + b
print(answer)

Submission status: Wrong Answer

Solution code:
import math
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:
    ans = H*(int(W/2))+math.ceil(H/2.0)
    print(int(ans))

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())# your code goes here
print((  ( (n+1) //2 )* ( (m+1)//2 ) ) + ((n//2)*(m//2)) )

Submission status: Wrong Answer

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

H_g = H//2
H_k = H - H_g

W_g = W//2
W_k = W - W_g
print(H_g*W_g+H_k*W_k)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

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

m = (h * w)

if m % 2 == 0:
    print(int(m / 2))
else:
    print(math.floor(m / 2) + 1)

Submission status: Wrong Answer

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

HW = H * W
HW2 = HW // 2
if HW % 2 == 0:
    ans = HW2
else:
    ans = HW2 + 1

print(ans)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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

N=H*W

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
if w == 1:
    print(int(1))
else:
    if h %2 == 0:
        print(int(h*w /2))
    else:
        tmp = (h+1)/2#多いほうの行けるマス数
        tmp1 = (h-1)/2#少ないほうの行けるマス数
        if w %2 == 0:
            print(int(h*w/2))
        else:
            print(int(h*(w-1)/2 +tmp))

Submission status: Wrong Answer

Solution code:
mi = lambda : map(int,input().split())

h,w = mi()
ans = 0

if h%2 ==0:
    hr = h
    hm = 0
else:
    hr = h-1
    hm = 1

if w%2 ==0:
    wr = w
    wm = 0
else:
    wr = w-1
    wm = 1

ans = hr * wr //2
ans += hr * wm //2 + wr * hm //2 

if(wm & hm):
    ans +=1

print(ans)

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
c=a*b
print(c-(c//2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-14 21:09:03 +0900
# LastModified: 2020-03-14 21:16:00 +0900
#


import os


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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H % 2 == 0:
  h_1 = H / 2
  h_2 = H / 2
else:
  h_1 = math.floor(H / 2) + 1
  h_2 = h_1 - 1

if W % 2 == 0:
  c = h_1 * W / 2
  c += h_2 * W / 2
else:
  width = math.floor(W / 2) + 1
  c = h_1 * width
  c += h_2 * (width - 1)
             
print(int(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import ceil
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    exit()
ans = 0
ans += ceil(W / 2) * ceil(H / 2)
ans += W // 2 * H // 2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Problem B - Bishop

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

if H%2==0: # even count
    print(H//2 * W)
else:
    even_count = (H//2+1) * (W//2 + 1)
    nokori  = W - W//2 - 1
    odd_count = H//2 * nokori
    print(even_count + odd_count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

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

print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H * W % 2 == 0:
    print("{}".format(int(H * W / 2)))
else:
    print("{}".format(int(H * W / 2 + 1)))

Submission status: Wrong Answer

Solution code:
import numpy as np


def main():
    h, w = map(int, input().split())
    if w % 2 == 0:
        a = w // 2
        b = a

    else:
        a = int(np.ceil(w / 2))
        b = a - 1

    if h % 2 == 0:
        ans = (h//2)*(a+b)
    else:
        ans = (h//2)*(a+b)+a

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math

HW = input().split()

H = int(HW[0])
W = int(HW[1])

#yoko
 
y1 = 0
y2 = 0
if W%2 == 1:
    y1 = int(W/2) + 1
    y2 = int(W/2)
else:
    y1 = int(W/2)
    y2 = y1

result = 0

if H%2 == 1:
    result += y1 * (int(H/2) + 1)
    result += y2 * int(H/2)
else:
    result += y1 * int(H/2)
    result += y2 * int(H/2)
    

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

# 標準入力 <int><int>
H, W = map(int, input().split())

ans = H * W // 2

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if a %2 == 0:
  #たて一列でぬれるのは
  c = int(a/2)
  print(c*b)
else:
  #たて一列目は
  d = int((a+1)/2)
  e = int((a-1)/2)
  if b %2 == 0:
    print(int((d+e)/2*b))
  else:
    print(int((d+e)/2*(b-1)+d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

x1 = ceil(W / 2)
x2 = W // 2

print(int(ceil(H / 2) * x1 + H // 2 * x2))

Submission status: Wrong Answer

Solution code:

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
s = input().rstrip().split(' ')
height = int(s[0])
width = int(s[1])
area = height * width
if area % 2 == 0:
	print(area / 2)
else:
	print(int(math.ceil(area / 2)))

Submission status: Wrong Answer

Solution code:
import math

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 

h, w = load_list()
if h == 1 or w == 1:
    print(1)
    exit()
if h*w % 2 == 0:
    print(int(h*w/2))
else:
    print(int((h*w-1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print("%d"%int(h*w//2+h//2*w%2))

Submission status: Wrong Answer

Solution code:
hei,wid=map(int,input().split())
s=0
s+=hei*wid
if s%2==0:
    print(s//2)
elif s%2!=0:
    print(s//2+1)
elif (hei==1 and wid>1) or (hei>1 and wid==1):
    print(1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
h1, h2 = divmod(h, 2)
w1, w2 = divmod(w, 2)
print(w*h1+h2*(w1+w2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    h, w = map(int, input().split())

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

    print(int(ans))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

x = H * W

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

Submission status: Wrong Answer

Solution code:
import sys
import math
input = sys.stdin.readline

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

    hw = math.ceil(W / 2)
    hh = math.ceil(H / 2)

    ans =  (hw * hh) + ((W - hw) * (H - hh))

    print(ans)



if __name__ == "__main__":
    main()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import *
n,m = input().split(' ')
if(n==1 or m==1):
    print(1)
else:
    print(ceil((int(n)*int(m))/2))

Submission status: Wrong Answer

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

vertical = int(HW[0] / 2) + (HW[0] % 2)
horizontal = int(HW[1] / 2) + (HW[1] % 2)

if (HW[0] == 1):
    print(horizontal)
elif (HW[1] == 1):
    print(vertical)
else:
    pairV = 0
    secondV = 0
    if (HW[0] % 2 == 0):
        pairV = vertical * 2
    else:
        pairV = vertical * 2 - 1
    if (HW[1] % 2 == 0):
        print(pairV * int(HW[1] / 2))
    else:
        tmp = pairV * int(HW[1] / 2)
        tmp += vertical
        print(tmp)

Submission status: Wrong Answer

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

if h % 2 == 0:
    if w % 2 != 0:
        ans = ((w // 2 + 1) * (h // 2)) + ((w // 2) * (h // 2))
    else:
        ans = ((w // 2) * (h // 2)) + ((w // 2) * (h // 2))
else:
    if w % 2 != 0:
        ans = ((w // 2 + 1) * (h // 2 + 1)) + ((w // 2) * (h // 2))
    else:
        ans = ((w // 2) * (h // 2 + 1)) + ((w // 2) * (h // 2))
print(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 numpy as np
import sys
h,w = map(int,input().split())
if w%2 == 0:
    print((w//2)*h)
else:
    if h%2 == 0:
        print((w//2+1)*(h//2) + (w//2)*(h//2))
    else:
        print((w//2+1)*(h//2+1) + (w//2)*(h//2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = [int(e) for e in input().split(" ")]
a = n[0] * n[1]
print(a // 2 if a % 2 == 0 else a // 2 + 1)

Submission status: Wrong Answer

Solution code:
L, S = map(int, input().split())

if L % 2 == 1 and S % 2 == 1:
    ans = int(L*(S-1)/2 + (L+1)/2)
else:
    ans = int(L*S/2)

print(ans)

Submission status: Wrong Answer

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


if a*b%2 == 0:
	print(a*b/2)
else:
	print(math.floor(a*b/2)+1)

Submission status: Wrong Answer

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

hc = (w+1) // 2
hc2 = hc
if w % 2 == 1:
    hc2 -= 1

d, m = divmod(h, 2)

ans = d * (hc + hc2) + m * hc
print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

odd = W // 2 + 1
even = W // 2

answer = 0
if W % 2 != 0 and W != 1:
    if H % 2 == 0:
        answer = (odd + even) * (H // 2)
    else:
        answer = (odd + even) * (H // 2) + odd
else:
    answer = even * H

if W == 1:
    answer = 1

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
H,W = map(int,input().split())
if H==1 or W==1:
    print(1)
sys.exit()
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())
k = h//2 if h%2==0 else h//2+1
g = h-k
can_k = w//2 if w%2==0 else w//2+1
can_g = w-can_k
print(k*can_k + g*can_g)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H = (h+1)//2
W = (w+1)//2

print(H*W + (h-H)*(w-W))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

odd_rows = sum(divmod(H, 2))
even_rows =  H//2
answer = sum(divmod(W, 2))*odd_rows
answer += W//2*even_rows

print(answer)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
if w == 1:
    print(1)
if h %2 == 0:
    print(int(h*w /2))
else:
    tmp = (h+1)/2#多いほうの行けるマス数
    tmp1 = (h-1)/2#少ないほうの行けるマス数
    if w %2 == 0:
        print(int(h*w/2))
    else:
        print(int(h*(w-1)/2 +tmp))

Submission status: Wrong Answer

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

c = a*b
if c % 2 == 1:
  print(c//2+1)
else:
  print(c//2)

Submission status: Wrong Answer

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

import math

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

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABCpana_B.py
from math import ceil
h,w=map(int,input().split())
if w%2==0:
    print(h*(w//2))
else:
    print(h*(w//2)+ceil(h/2))

Submission status: Wrong Answer

Solution code:
import bisect,collections,itertools,math,numpy,string
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
##################################################
def main(H,W):
    if H%2==0 and W%2==0:
        return (H*W)//2
    elif H%2==0 and W%2==1:
        return (H//2)*(2*(W//2)+1)
    elif H%2==1 and W%2==0:
        return (2*(H//2)+1)*(W//2)
    else:
        return (H//2)*(2*(W//2)+1)+2*(W//2)
    return _HW
    
H,W = LI()
print(main(H,W))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
height, width = map(int, input().split())

if width%2 == 0:
    num_1 = width/2
    
    result = num_1 * height
    
else:
    num_1 = int(width/2) + 1
    
    if height%2 == 0:
        result = (num_1 + (num_1 - 1)) * height/2
    else:
        result = (num_1 + (num_1 - 1)) * int(height/2) + num_1

print(int(result))

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:
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np

# A = input()
# A = int(input())
H, W = map(int, input().split())
# A = list(map(int, input().split()))
# A = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
h, w = map(int, input().split())
first_row = math.ceil(w/2)
second_row = int(w/2)
if h % 2 == 0:
  ans = (first_row + second_row) * (h // 2)
else:
  ans = (first_row * math.ceil(h / 2)) + (second_row * int(h / 2))
  
print(ans)

Submission status: Wrong Answer

Solution code:
import math
s = input().rstrip().split(' ')
height = int(s[0])
width = int(s[1])
area = height * width
if area % 2 == 0:
	print(area / 2)
else:
	print(math.ceil(area / 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = int(W // 2 *H)

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

h, w = [int(v) for v in input().split()]
if 1 in [h, w]:
    print(1)
print(math.ceil(h * w / 2))

Submission status: Wrong Answer

Solution code:
import math

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