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 = 0

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

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

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
HW = input().split()
H = int(HW[0])
W = int(HW[1])
print(H*W-H*W%2)

Submission status: Wrong Answer

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

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

print(a)

Submission status: Wrong Answer

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

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

if h==1 or w==1:
  ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
input = raw_input

h, w = map(int, input().split(" "))
t =  h *w 

if w % 2 == 1: 
    n1 = 1 + ((w-1) // 2) 
    n2 = ((w-1) // 2)
else:
    n1 = w // 2
    n2 = n1



if h % 2 == 1: 
    h1 = 1 + ((h-1) // 2) 
    h2 = ((h-1) // 2)
else:
    h1 = h // 2
    h2 = h1

out = h1 * n1 + h2 * n2
print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = [int(i) for i in input().split(' ')]
 
A = num[0] * num[1]
if(A % 2 == 0):
  print(int(num[0] * num[1] / 2))
else:
  print(int((A-1) / 2 + 1))

Submission status: Wrong Answer

Solution code:
import math
hw=list(map(int, input().split())) 
h=hw[0]
w=hw[1]
answer=int(math.ceil((h/2)*w))
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-


def count(H, W):
    if W % 2 == 0:
        return int(W * H / 2)
    else:
        w2 = int(W / 2)
        w1 = w2 + 1
        
        if H % 2 == 0:
            return int((w1 + w2) * H / 2)
        else:
            return int((w1 + w2) * int(H / 2) + w1)


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

    print(count(H, W))


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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#B
import math
h,w=map(int,input().split())
if h==w==1:
    print(0)
elif h%2==0 and w%2==0:
    print(h*w/2)
elif h%2==0 and w%2!=0:
    print(h*(w-1)/2+math.floor(h/2))
elif h%2!=0 and w%2==0:
    print(w*(h-1)/2+math.floor(w/2))
else:
    print((w-1)*(h-1)/2+math.floor(h/2)+math.floor(w/2)+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


def main():
    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 * w // 2 + h // 2 + 1
    print("%d" % ans)


if __name__ == '__main__':
    main()

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	H, W = map(int, input().split())

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

	print(int(ans))

Submission status: Wrong Answer

Solution code:
def Main(H, W):
    if W%2:
        if H%2:
            return W*(H//2)+(W//2+1)
        else:
            return W*(H//2)
    else:
        if H%2:
            return W*(H//2)+W//2
        else:
            return W*(H//2)
                

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

if __name__ == '__main__':
    main()

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-1)//2) + wi
print(ans)

Submission status: Wrong Answer

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

if R % 2 == 0:
    print(int(R / 2 * C))
else:
    if C % 2 == 0:
        print(int(((R // 2 + 1) + (R // 2)) * C / 2))
    else:
        print(int((R // 2 + 1)*(C//2+1) + (R // 2)*(C//2)))

Submission status: Wrong Answer

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

num = h*w

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = input().split()
Hnum = int(H)
Wnum = int(W)
counter = 0
tmp = 0
if Hnum%2 == 0:
    counter = int(Hnum/2 * Wnum)
else:
    for i in range(1,Wnum+1):
        if i%2 ==1:
            tmp += 1
    Hnum -=1        
    counter = int(Hnum/2 * Wnum +tmp)

print(counter)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if H%2 == 0:
    h1 = H // 2
    h2 = H // 2
else:
    h1 = H // 2 + 1
    h2 = H // 2

if W%2 == 0:
    w1 = W // 2
    w2 = W // 2
else:
    w1 = W // 2 + 1
    w2 = W // 2

print(h1 * w1 + h2 * w2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    if w%2 == 1:
        c = w//2 + 1

    ans += r * c

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
val = input().split(' ')
h = int(val[0])
w = int(val[1])

square_num = h * w
result = square_num / 2
if square_num % 2 == 1:
    result += 0.5
print(int(result))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import heapq


def input():
    return sys.stdin.readline()[:-1]


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


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
c = [int(i) for i in input().split()]
a = c[0]
b = c[1]

r1 = (int(b/2) + b%2)*(int(a/2) + a%2)
r2 = (int(b/2)) * (int(a/2))

print(r1+r2)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

syou, amari = divmod(h, 2)
if w % 2 == 1:
    a = w // 2 + 1
    ans = (a + a - 1)* syou + a * amari
else:
    a = w / 2
    ans = (a + a)* syou + a * amari
print(int(ans))

Submission status: Wrong Answer

Solution code:
N , M = (map(int , input().split()))
t = -(-N//2)
y = -(-M//2)
if M % 2 == 1:
    idou = y - 1
else:
    idou = y

if N % 2 == 0:
     ans = ((y + idou)) * (N//2)
else:
     ans = ((y + idou) * (N//2)) + y
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a=input().split(' ')
if(int(a[0])==1):
    print(1)
else:
    if(int(a[1])==1):
        print(1)
    else:
        print(math.floor(int(a[0])*int(a[1])/2))

Submission status: Wrong Answer

Solution code:


def resolve():
    H,W = map(int,input().split())
    dd= W*(H//2)

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())

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

Submission status: Wrong Answer

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

print((h//2 + (h%2 != 0)) + (w//2)*(h) )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if R == 1 or C == 1:
  print(0)
elif R % 2 == 0:
  n = R/2
  print(int(n * C))
else:
  n1 = (R+1) / 2
  n2 = n1 - 1
  c1 = int((C+1)/2)
  c2 = C -c1
  print(int(n1*c1 + n2*c2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    h, w = map(int, args[0].split())
    ret = 0
    if h % 2 == 0:
        ret = (h//2)*w
    elif w % 2 == 0:
        ret = (h//2)*w + w//2
    else:
        ret = (h//2)*w + (1 + w//2)
    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0

if H%2 == 0:
  len = H/2
  ans += math.ceil(W/2)*len + math.floor(W/2)*len
if H%2 != 0:
  len = H/2
  ans += math.ceil(W/2)*(len+1) + math.floor(W/2)*len
  
print(round(ans))

Submission status: Wrong Answer

Solution code:
s = input().split()
H = int(s[0])
W = int(s[1])
if H == 1 or W == 1:
  print(1)
else:
  tmp = H // 2
  tmp2 = H % 2
  ret = tmp  * W + tmp2 * (W // 2 + 1 )
  print(ret)

Submission status: Wrong Answer

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

ans = 0
ans += (h//2) * w

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

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

Submission status: Wrong Answer

Solution code:
base = input().split()
h = int(base[0])
w = int(base[1])
if h%2==1:
    ha = (h//2)+1
    hb = ha-1
else:
    ha = h/2
    hb = ha
g = w//2
if w%2==1:
    ans = ha*(g+1)+hb*g
else:
    ans = (ha+hb)*(w/2)
print(int(ans))

Submission status: Wrong Answer

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


if h == 0 or w == 0:
  print(1)
elif (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())
#１列の縦に何個か
count = 0
for i in range(0,h,2):
    count += 1
#print(count)
if h % 2 == 0:
    print(count * w)
else:
    #a = math.ceil(w/2)
    a = math.floor(w/2)
    #print(a)
    print((w - a) * count + (count - 1) * a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


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

Submission status: Wrong Answer

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

    print(count)

if __name__ == '__main__':
    resolve()

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:
import math
H, W = map(int, input().split())
ans = 0
if W % 2 == 0:
    f, n = W // 2, W // 2
else:
    f = math.ceil(W / 2)
    n = f - 1
if H % 2 == 0:
    kakeru = H // 2
    ans += f * kakeru + n * kakeru
else:
    kakeru = H // 2
    n_kakeru = H - (H // 2)
    ans += f * n_kakeru + n * kakeru
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 奇数と奇数の時だけ 積 // 2 に + 1 する

a, b = map(int, input().split())

if a % 2 == 1 and b % 2 == 1:
    print(a * b // 2 + 1)
    # print("a")

else:
    print(a * b // 2)
    # print("b")

Submission status: Wrong Answer

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

if h % 2 == 0:
    tate = h // 2
    print(tate * w)
    exit(0)
else:
    tate1 = h // 2 + 1
    tate2 = tate1 - 1
    if w % 2 == 0:
        print(tate1 * (w // 2) + tate2 * (w // 2))
        exit(0)
    else:
        yoko1 = w // 2 + 1
        yoko2 = yoko1 - 1
        print(tate1 * yoko1 + tate2 * yoko2)
        exit(0)

Submission status: Wrong Answer

Solution code:
tate,yoko=map(int,input().split())
gyou=0
masu=0
if yoko%2==1:
  gyou=int(yoko/2)+1
  if tate%2==1:
    masu+=gyou*(int(tate/2)+1)
    masu+=(gyou-1)*int(tate/2)
  else:
    masu+=(gyou+gyou-1)*int(tate/2)
else:
  gyou=int(yoko/2)
  if tate%2==1:
    masu+=gyou*(int(tate/2)+1)
    masu+=(gyou)*int(tate/2)
  else:
    masu+=(gyou+gyou)*int(tate/2)
print(masu)

Submission status: Wrong Answer

Solution code:
HW = [int(i) for i in input().split()]
h = HW[0]
w = HW[1]
if h % 2 == 0:
    ans = h*w/2
else:
    if w % 2 == 0:
        ans = h * w / 2
    elif( w>h ):
         ans = (w * (h - 1) / 2) + ((w + 1) / 2)
    else:
        ans = (h * (w - 1) / 2) + ((h + 1) / 2)
ansint = int(ans)
print (ansint)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

print(ans)

Submission status: Wrong Answer

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

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

    if w%2 == 1:
        c = w//2 + 1

    ans += r * c

print(ans)

Submission status: Wrong Answer

Solution code:
height, width = [int(i) for i in input().split(' ')]

reachables = 0
width_arr = range(width)

for h in range(height):
    reachables += len(width_arr[::2]) if h %2 == 0 else len(width_arr[1::2])
print(reachables)

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
a=(w+2-1)/2
z=((w+2-1)/2)-1
c=a+z

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
a,b=map(int,input().split())
int(a)
int(b)
c=a*b
int(c)
if c%2==0:
    d = c/2
    print(int(d))
else:
    d = math.floor(c/2) + 1
    print(int(d))

Submission status: Wrong Answer

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

# num = H * W

if H % 2 == 0 and W % 2 != 0:
    print(int(H/2 * W))
elif H % 2 == 0:
    print(int(H/2 * W))
elif W % 2 == 0:
    print(int(W/2) * H)
else:
    ans = 0
    for i in range(W//2):
        ans += H

    print(ans + (H-(H//2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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)

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 (hei==1 and wid>=1) or (hei>=1 and wid==1):
    print(1)
elif s%2!=0:
    print(s//2+1)
else:
    print(1)

Submission status: Wrong Answer

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

if R % 2 == 0:
    print(int(R / 2 * C))
else:
    if C % 2 == 0:
        print(((R // 2 + 1) + (R // 2)) * C / 2)
    else:
        print((R // 2 + 1)*(C//2+1) + (R // 2)*(C//2))

Submission status: Wrong Answer

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

print(A)

Submission status: Wrong Answer

Solution code:
height, width = map(int, input().split())
 
if width == 1:
  result = 1
  
elif width%2 == 0:
    num_1 = width/2
    
    result = num_1 * height
    
else:
    num_1 = int(width/2) + 1
    
    if height == 1:
        result = num_1
    elif height%2 == 0:
        result = (num_1 + (num_1 - 1)) * height/2
    else:
        result = (num_1 + (num_1 - 1)) * int(height/2) + num_1

Submission status: Wrong Answer

Solution code:
xy = input('')
x = int(xy.split(' ')[1])
y = int(xy.split(' ')[0])

xs1 = x//2 +1
xs2 = x//2
if y%2 == 0:
	result = xs1 * y//2 + xs2 * y//2
else:
	result = xs1 * y//2 + xs2 * y//2 + xs1
print(result)

Submission status: Wrong Answer

Solution code:
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

H, W = map(int, input().split())
# dump(S)
print((H//2)*W+((W+1)//2)*(H % 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
if W > 0:
	HW = H*W
	print(sum(divmod(HW, 2)))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''
#codeforces
gi = lambda : list(map(int,input().split()))
n, m = gi()
l = m // 2 + m % 2
ans = l * (n // 2 + n % 2) + (m // 2) * (n // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
num = [int(i) for i in input().split(' ')]

A = num[0] * num[1]
if(A % 2 == 0):
  print(num[0] * num[1] / 2)
else:
  print((A-1) / 2 + 1)

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())                            # 1行2列

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

if W == 0:
	print(0)
else:
	print(int(SUM))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a=input().split(' ')
if(int(a[0])==1):
    print(a[1])
else:
    if(int(a[1])==1):
        print(a[0])
    else:
        print(math.floor(int(a[0])*int(a[1])/2))

Submission status: Wrong Answer

Solution code:



hi, wd = map(int, input().split())


# いずれかが１の場合
if hi==1 or wd ==1:
    print(0)

# heightまたはwidthが偶数だった場合
if hi%2 == 0 or wd%2 == 0:
    print(hi*wd//2)
else:
    print(hi*wd//2 + 1)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Problem B - Bishop

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

if H==1 or W==1:
    print(0)
elif 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:
import math
H,W = map(int,input().split())

if H==1 or W==1:
  print(1)
  exit()
  
x = H*W
if x % 2==0:
  print(x/2)
elif x% 2 ==1:
  print(int(math.ceil(x/2)))

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
	h, w = MAP()
	if h > 1 or w > 1:
		print(ceil((h * w) / 2))
	else:
		print(1)

if __name__=='__main__':
	main()

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
h_a = h // 2
w_a = w // 2
if((h_a == 0) & (w_a == 0)):
  print(h_a * w_a)
elif((h_a == 1) & (w_a == 0)):
  print((h_a+1) * w_a)
elif((h_a == 0) & (w_a == 1)):
  print(h_a * (w_a + 1))
elif((h_a == 1) & (w_a == 1)):
  print((h_a + 1) * (w_a + 1))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

def main():
    H,W = list(map(int, input().split(' ')))
    print(math.ceil((W*H)/2))
main()

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 = [int(i) for i in input().split()]
r = h*w
if r % 2 == 1:
    r += 1
print(r // 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:
def Main(H, W):
    if W%2:
        if H%2:
            return H*(W//2)+(W//2+1)
        else:
            return H*(W//2)
    else:
        if H%2:
            return H*(W//2)+W//2
        else:
            return H*(W//2)
                

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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