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

print(ans)

Submission status: Wrong Answer

Solution code:
H,W=(int(x) for x in 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:
# B
H,W = map(int,input().split())
ans = 0
if (H == 1 or W == 1):
    ans = 1
else:
    if (H % 2 == 0):
        ans = W * (H // 2)
    else:
        ans = W * (H // 2) + W // 2 + 1
print(ans)

Submission status: Wrong Answer

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

if h % 2 == 0:
  a = 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:
import sys
input = sys.stdin.readline

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

ans = 0

for i in range(H):
    if i > 0 and i % 2 == 0:
        ans += min(H - i, W)

for j in range(W):
    if j > 0 and j % 2 == 0:
        ans += min(H, W - j)

ans += min(H, W)

print(ans)

Submission status: Wrong Answer

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

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

print(int(x))

Submission status: Wrong Answer

Solution code:
def solve():
    h, w = list(map(int, input().split()))
    
    if w == 1 or h == 1:
        print(0)
        return
    
    _odd = ((w + 1) // 2) * ((h + 1) // 2)
    _even = (w // 2) * (h // 2)

    print(_odd + _even)

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
h, w = [int(i) for i in 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:
h, w = map(int, input().split())
a = h * w
print(a//2+a%2)

Submission status: Wrong Answer

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

m1=int((W+1)/2)
m2=int(W/2)

n1=int((H+1)/2)
n2=int(H/2)

print(m1*n1+m2*n2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

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

print(ans // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = (int(x) for x in input().split())
print(int((h//2+h%2)*(w//2+w%2)+(h//2)*(w//2)))

Submission status: Wrong Answer

Solution code:
import math

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

if w % 2 == 0:
    print(w // 2 * h)
else:
    a = math.ceil(w / 2)
    b = w - a
    if h % 2 == 0:
        print(a * h // 2 + b * h // 2)
    else:
        h_a = math.ceil(h / 2)
        h_b = h - h_a
        print(a * h_a + b * h_b)

Submission status: Wrong Answer

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

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

ans = 0
# for i in range(h):
#     if i % 2 == 0:
#         ans += w // 2 + 1
#     else:
#         ans += w // 2
if w % 2 == 0:
    ans = int(h * w / 2)
else:
    if h % 2 != 0:
        ans = h * w // 2 + 1
    else:
        ans = h * w // 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):
    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 == 1 or w == 1: exit(print(1))
a1 = h//2 + 1 if h % 2 != 0 else h//2
a2 = h - a1
a3 = w//2 + 1 if h%2!=0 else w//2
a4 = w - a3
ans = a1*a3 + a2*a4
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


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


# Run main
if __name__ == '__main__':
    Solution().main()

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
h, w = map(int, input().split())
ans = 0
if h % 2 == 0:
    ans = h // 2 * w
else:
    if w % 2 == 0:
        ans = (h // 2 + 1) * (w // 2) + (h // 2) * (w // 2)
    else:
        ans = (h // 2 + 1) * (w // 2 + 1) + (h // 2) * (w // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
print(n*(m//2)-(-n//2)*(m%2))

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:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]



H, W = LI()

ans = H*W

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

H, W = input_nums()

horizontal = 0
ans = 0

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

Submission status: Wrong Answer

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

N=H*W

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

Submission status: Wrong Answer

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

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

print(A)

Submission status: Wrong Answer

Solution code:
l, c = map(int, input().split())

ans = int(int(l+1)/2) * int(int(c+1) / 2)
ans = ans + int(l/2) * int(c/2)
print (ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = a * b
print(s // 2 + s % 2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter

# import numpy as np
# import scipy as scp

# 入力の受け取り
h,w = map(int,input().split())

if h%2 == 0:
    ans = (h*w)//2
else:
    w1 = w//2
    w2 = w-w1
    ans = h//2*w1 + ((h+1)//2)*(w2)
    
print(ans)
# print("{:.10f}".format(ans))

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#スペース区切りの整数の入力
H, W = map(int, input().split())

#偶数
H_2 = int(H/2)
W_2 = int(W/2)

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


print(ans)

Submission status: Wrong Answer

Solution code:
h,w = [int(i) for i in input().split()]
a = (w + 1) // 2
n = (h + 1) // 2
print(a*n + (w-a)*(h-n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    resolve()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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


if h == 1:
    print((w//2) + 1)
    exit()
elif w == 1:
    print((h//2) + 1)
    exit()


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

Submission status: Wrong Answer

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

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

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

main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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)
print(ans==500000000000000000)

Submission status: Wrong Answer

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

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

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:
  c = h_1 * (math.floor(W / 2) + 1)
  c += h_2 * math.floor(W / 2)
             
print(int(c))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

even_rows = h // 2
odd_rows = h // 2
if h % 2 == 1:
    odd_rows += 1

ans = 0
ans += w // 2 * even_rows
ans += (w+1) // 2 * odd_rows

print(ans)

Submission status: Wrong Answer

Solution code:

def main():
    temp = list(map(int,input().split(' ')))
    H = temp[0]
    W = temp[1]

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

    if H % 2 == 1:
        h = int(H/2) + 1
        h1 = int(H/2)
    else:
        h = int(H/2)
        h1 = int(H/2)

    if W % 2 == 1:
        w = int(W/2) + 1
        w1 = int(W/2)
    else:
        w = int(W/2)
        w1 = int(W/2)

    print(w*h + w1*h1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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


H, W = na()
if H == 1 or W == 1:
    print(1)
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 = [int(x) for x in 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())
ans = h * w
print((ans // 2) + 1 if ans % 2 == 1 else ans // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    main()

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

seki = W*R

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

Submission status: Wrong Answer

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

base = math.ceil(W / 2)

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

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

T = H * W

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

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 = H / 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(' '))
masu=0

masu=masu+(w*(h//2))

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

print(masu)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:11:42 2020

@author: Kanaru Sato
"""

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

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

print(ans)

Submission status: Wrong Answer

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

a=(h+1)//2
b=(h)//2
print(b*(w//2)+a*((w+1)//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


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

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

    print(even_row + odd_row)


if __name__ == "__main__":
    submit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if w%2 != 0:
    tmp = w//2+1
    tmp2 = tmp -1
else:
    tmp = int(w/2)
    tmp2 = tmp


if h&2 == 0:
    #ans = int(h/2) * tmp + int(h/2) + tmp2
    ans = tmp*h
else:
    ans = (h//2+1) * tmp + h//2 * tmp2

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
        # 内包表記はpypyでは若干遅いことに注意
        # #numpy使うだろうからこれを残しておくけど
    return ret


# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from fractions import gcd


def lcm(a, b):
    # 最小公約数
    g = gcd(a, b)
    return a * b // g


H, W = read_ints()

# 市松模様を分解してカンガル
# Hはそのまま詰める
print((H * (W // 2)) + (W % 2) * ((H + 1) // 2))

Submission status: Wrong Answer

Solution code:
#def main(S, b):
if __name__ == '__main__':
    h, w = map(int, input().split())

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

    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
#sys.stdin=open("input.in","r")
#sys.stdout=open("output.out","w")
n,m=map(int,input().split())
print(math.ceil((n*m)/2))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
Rodd = (W + 2 - 1) // 2
Reven = W - Rodd
odd = (H + 2 - 1) // 2
even = H - odd
total = Rodd * odd + Reven * even

print(total)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

H,W = inpl()

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def solve(H: int, W: int):
    decimal.getcontext().prec = 30
    if(H==1 or W==1):
        print(0)
        return
    if(H*W%2==0):
        print(decimal.Decimal(H*W/2))
    else:
        print(decimal.Decimal(H*W//2+1))
    return


# Generated by 1.1.6 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:
import math 


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

Submission status: Wrong Answer

Solution code:
from math import ceil
h, w = [int(i) for i in input().split()]
print((ceil(h/2) * ceil(w/2)) + (h//2) * (w//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = [int(s) for s in input().split()]
if not n%2:
    ans = (n//2)*m
else:
    ans = (n//2)*m + m//2 + m%2
print(ans)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
H,W = map(int, input().split())

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

Submission status: Wrong Answer

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

kisuu = (w+1)//2
guusuu = w//2
tate_kisuu = (h+1)//2
tate_guusuu = h//2


res = kisuu*tate_kisuu+guusuu*tate_guusuu


print(res)