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

Submission status: Wrong Answer

Solution code:
def solve():
    N, M = map(int, input().split())
    if N % 2 == 1 and M % 2 == 1:
        return int(N/2 * M) + 1
    else:
        return int(M/2*N)

print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
if __name__ == "__main__":
    H, W = map(int, input().split())
    ret = H * W
    if ret % 2 == 0:
        ret = ret / 2
    else:
        ret = math.floor(ret / 2) + 1
    print(int(ret))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

m = (h * w)

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
if w % 2 == 0:
  ans = c * (w//2) + d*(w//2)
else:
  ans = c * (w//2+1) + d*(w//2)
print(ans)

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
r = 0
for i in range(0, W, 2):
  r += min(W - i, H)
for j in range(2, H, 2):
  r += min(H - j, W)
print(r)

Submission status: Wrong Answer

Solution code:
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

H,W = nm()
print((H * W + 1)//2)

Submission status: Wrong Answer

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

a = w//2
b = w - a

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

else:
    ans = a*h//2 + b*h//2 + a
    print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

m = 0
h = a[0]
w = a[1]

'''
for hi in range(h):
    for wi in range(w):
        if hi + wi == 2 or hi - wi == 0 or wi - hi == 0:
            m += 1

print(m)
'''

m = math.ceil(h*w / 2.0)
print(m)

Submission status: Wrong Answer

Solution code:
a = input().split()

x = int(a[0]) * int(a[1])
x = x/2

if(x == int(x)):
  print(int(x))
else:
  print(int(x) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

y1 = 1 + (H-1) // 2
y2 = H // 2

print((W//2)*(y1+y2) + (W%2)*y1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


H, W = MI()
ans = (H // 2) * (W // 2) * 2
if H % 2 != 0:
    ans += H // 2
if W % 2 != 0:
    ans += W // 2
if H % 2 != 0 and W % 2 != 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# b.py
import math
h, w = map(int, input().split())
if h > pow(10, 9) or w > pow(10, 9):
    pass
else:
    print(math.ceil((h * w) / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
ans = ((H+1)//2)*((W+1)//2) + (H//2)*(W//2)

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = [int(x) for x in input().split()]
ans = int(a*b/2)+1
if (a*b) % 2 == 0:
  ans = a*b/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-1)/2)+int(H/2)+1)

Submission status: Wrong Answer

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

H, W = map(int, input().split(' '))
ans = 0
ans += int(math.ceil(W/2)) * int(math.ceil(H/2))
ans += W//2 * 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:
        print((h*w)//2)
    elif h%2!=0:
        if w>=2:
            print((h*w+1)//2)
        else:
            print(1)

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:
    if H % 2 == 0:
        answer = (odd + even) * (H // 2)
    else:
        answer = (odd + even) * (H // 2) + odd
else:
    answer = even * H

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil, floor
H, W = map(int,input().split())
sum = 0
if H % 2 == 0:
  sum = W * H / 2
else:
  if W % 2 == 0:
    sum = ceil(H / 2) * W / 2 + floor(H / 2) * W / 2
  else:
    sum = ceil(H / 2) * ceil(W / 2) + floor(H / 2) * floor(W / 2)
print(int(sum))

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 math
a,b=map(int,input().split())
c=a*b
if c%2==0:
    d = c/2
else:
    d = math.floor(c/2) + 1
print(d)

Submission status: Wrong Answer

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

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

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:
    a = max(h, w)
    if min(h, w) == 1:
        print(1)
        exit()
    print(min(h, w) * (a // 2) + min(h, w)//2+1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math
H, W = map(int, input().split())
if (H%2==0):
  print(int(W*H/2))
else:
  if(W%2==0):
    print(int(H*W/2))
  else:
    print(int(((H+1)/2) + (H*(W-1)/2)))

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

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

if(H%2 != 0):
    ha = H//2+1
    hb = H//2
else:
    ha = H//2
    hb = H//2
if(W%2 != 0):
    wa = W//2+1
    wb = W//2
else:
    wa = W//2
    wb = W//2
print(ha*wa+hb*wb)

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    a = (m + 1) // 2
    b = m // 2
    ans = a * ((n + 1) // 2) + b * (n // 2)
    print(ans)

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
H, W = [int(str) for str in input().strip().split()]

# print(((W + 1) // 2) * ((H + 1) // 2) + (W // 2) * (H // 2))
print((H * W + 1) // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def main():
    H, W = MI()
    print(ceil(H*W/2))
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(int((H * W + 1) / 2))

Submission status: Wrong Answer

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


def solve(H: int, W: int):

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

    return


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

Submission status: Wrong Answer

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

import sys

a = (W+1)//2+(W//2)

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

if H%2 == 0:
    print(a*(H//2))
else:
    print(a*(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:
h, w = map(int, input().split())
if h%2 == 0 :
    print(int(h*w/2))
else :
    result = 0
    for i in range(0, w) :
        if i%2 == 0 :
            result += int(h/2) + 1
        else :
            result += int(h/2)
    print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve():
    N, K = [int(_) for _ in raw_input().split()]
    if N % 2 == 0 or K % 2 == 0:
        ret = N * K /2
    else:
        ret = N * K /2 + 1
    print ret

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def main():
  import sys
  input = sys.stdin.readline
  h,w=map(int,input().split())
  if h==1:
    print(w//2 if w%2==0 else w//2+1)
    exit()
  if w==1:
    print(h//2 if h%2==0 else h//2+1)
    exit()
  if h%2==0:
    print(w*h//2)
  else:
    print((h//2)*w+w//2+1)
  
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
if(w%2==1):
    w1=(w//2)+1
    w2=w//2
else:
    w1=(w//2)
    w2=(w//2)+1
if(h%2==1):
    h1=(h//2)+1
    h2=(h//2)
else:
    h1=(h//2)
    h2=(h//2)+1

if(w%2==1 and h%2==1):
    ans=w1*h1+w2*h2
elif(w%2==1 and h%2==0):
    ans=w1*h1+w2*h1
elif(w%2==0 and h%2==1):
    ans=w1*h1+w2*h2
else:
    ans=w1*h1+w2*h1
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:
i = list(map(int, input().split()))
H = i[0]
W = i[1]

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np
from operator import itemgetter

#N = int(stdin.readline().rstrip().split()[0])
H, W = [int(x) for x in stdin.readline().rstrip().split()]
#A = [int(x) for x in stdin.readline().rstrip().split()]

MOD = 10**9 + 7
H_2 = H//2
W_2 = W//2

ans = W*H_2
if H%2 != 0:
  ans += W_2
  if W%2 != 0:
    ans += 1

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

Submission status: Wrong Answer

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

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

else:
    H_count = H // 2
    count = H_count * W

print(int(count))

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
def main():

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

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
import math
if n==1 and m==1:
	print(1)
	exit()
if n*m%2==0:
	print(m*n//2)
else:
	print(m*n//2+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
h,w = map(int,input().split())
# 奇数番目は(h+1)//2 個取れる　偶数番目はn//2
ans = ((h+1)//2) * ((w+1)//2) + (h-(h+1)//2) * (w-(w+1)//2)
print(ans)

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

Submission status: Wrong Answer

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

w_1 = int((num[1]+1)/2)
w_2 = int(num[1]/2)

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

ans = h_1*w_1 + h_2*w_2

print(ans)

Submission status: Wrong Answer

Solution code:
h, w = [int(i) for i in input().split()]
if h == 1 or w == 1:
    print(1)
    
a = (h + 1) // 2
b = h // 2
c = (w + 1) // 2
d = w // 2
print(a*c+b*d)

Submission status: Wrong Answer

Solution code:
from sys import exit, setrecursionlimit
setrecursionlimit(10**6)

def array2D(row, col ,val=0):
    return [[val]*col for i in range(row)]

from math import ceil
h,w = map(int, input().split())
ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if 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(" "))
kake = h*w

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    H, W = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))
    a = (H // 2) * (W // 2)
    b = math.ceil(H / 2) * math.ceil(W / 2)
    print(a + b)


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """4 5"""
        output = """10"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """7 3"""
        output = """11"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1000000000 1000000000"""
        output = """500000000000000000"""
        self.assertIO(input, output)

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())
#print(h,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())
if h == 1 or w == 1:
  print(0)
elif (h * 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())

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

print(ans)

Submission status: Wrong Answer

Solution code:
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)
    
    cnt = acnt * int(H/2) + bcnt * int((H-1)/2)
    return cnt

print(solve(H, W))

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:
(a, b) = list(map(int, input().split()))
i= a//2
p = i* b
j = 0
if a % 2 == 1:
  j = (b+1) // 2 

p += j
print(p)

Submission status: Wrong Answer

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

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    h,w=list(map(int, readline().strip().split()))

    ki=(w+1)//2
    gu=w//2

    amari=h%2
    half=h//2
    masu=(amari+half)*ki+half*gu
    #arr=list(map(int, readline().strip().split()))
    #n=int(readline().strip())
    print(masu)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまでコピぺえ 
### ----------------

Submission status: Wrong Answer

Solution code:
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H,W = IL()

numa = math.ceil(W/2)
numb = W//2

numc = math.ceil(H/2)
numd = H//2

ans = numa*numc + numb*numd

print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil

data = input().split()
h, w = [int(i) for i in data]
print(ceil(h/2) * ceil(w/2) + int(h/2) * int(w/2))

Submission status: Wrong Answer

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

n1 = math.ceil(W/2)
n2 = math.floor(W/2)
m1 = math.ceil(H/2)
m2 = math.floor(H/2)

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

Submission status: Wrong Answer

Solution code:
# 2入力
H, W = map(int, input().split())

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

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:11:03 +0900
#


import os


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


if __name__ == "__main__":
    main()

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


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

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

print(ans)

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

print(ans)

Submission status: Wrong Answer

Solution code:

def main():
    temp = list(map(int,input().split(' ')))
    H = temp[0]
    W = temp[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()