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

H_even = int(H/2)*2
W_even = int(W/2)*2

a = int((H_even * W_even)/2)
b = int(H_even/2) if W % 2 != 0 else 0
c = int(W_even/2) if H % 2 != 0 else 0
d = 1 if H % 2 != 0 and W % 2 != 0 else 0

print(a+b+c+d)

Submission status: Wrong Answer

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

H_even = int(H/2)*2
W_even = int(W/2)*2

a = int(H_even * W_even/2)
b = int(H_even/2) if W % 2 != 0 else 0
c = int(W_even/2) if H % 2 != 0 else 0
d = 1 if H % 2 != 0 and W % 2 != 0 else 0

print(a+b+c+d)

Submission status: Wrong Answer

Solution code:
import math

H,W = list(map(int,input().split(" ")))
if W > 1:
    print(math.ceil((H*W)/2))
else:
    print(1)

Submission status: Wrong Answer

Solution code:
import math

H,W = list(map(int,input().split(" ")))
if W > 1:
    print(math.ceil((H*W)/2))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
# Bishop
import math

H,W = list(map(int,input().split(" ")))
if W > 1:
    print(math.ceil((H*W)/2))
else:
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

q, mod = divmod(h*w, 2)
print(q+mod)

Submission status: Wrong Answer

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

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

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

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

# print(4 * 2 + 3 * 1)

Submission status: Wrong Answer

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

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

H, W = map(int, input().split())
ans = (-H//2) * (-W//2) + (H//2) * (W//2)
print(ans)

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

# print(4 * 2 + 3 * 1)

Submission status: Wrong Answer

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

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]
import math
H, W = map(int, input().split())
ans = math.ceil(H/2) * math.ceil(W/2) + math.floor(H/2) * math.floor(W/2)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

H, W = map(int, input().split())
if H or W ==1:
    print(1)
    sys.exit()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if h == 1:
    odd = 1
else:
    odd = math.ceil(h/2) * math.ceil(w/2)
even = int(h/2) * int(w/2)

print(even + odd)

Submission status: Wrong Answer

Solution code:
h,w = [int(i) for i in input().split()]
if h == 1 or w == 1:
    print(1)
if h % 2 == 1 and w % 2 == 1:
    print(int(h*w/2) + 1)
else:
    print(int(h*w/2))

Submission status: Wrong Answer

Solution code:
h,w = [int(i) for i in input().split()]
if h % 2 == 1 and w % 2 == 1:
    print(int(h*w/2) + 1)
else:
    print(int(h*w/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, open(0).read().split())

print(sum(divmod(h*w, 2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import math

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

result = math.ceil(H * W / 2)

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = [int(i) for i in input().split()]
print(int((H*W)/2 + 0.5))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(round(Ans))

Submission status: Wrong Answer

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

A=[0,math.ceil(W/2)]
if (H-1)*(W-1)!=0:
  c=W*math.floor(H/2)+A[H%2]
else:
  c=0
print(c)

Submission status: Wrong Answer

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

A=[0,math.ceil(W/2)]
c=W*math.floor(H/2)+A[H%2]

print(c)

Submission status: Wrong Answer

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

A=[0,math.ceil(W/2)]
c=W*math.ceil(H/2)+A[H%2]

print(c)

Submission status: Wrong Answer

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

A=[0,math.floor(W/2)]
c=W*math.ceil(H/2)+A[H%2]

print(c)

Submission status: Wrong Answer

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

if H%2 == 0:
    if W%2 == 0:
        sum = W*H/2
    elif W%2 != 0:
        sum = ((W//2)+1)*(H//2) + (W//2)*(H//2)
elif H%2 != 0:
    if W%2 == 0:
        sum = ((W//2))*((H//2)+1) + (W//2)*(H//2)
    elif W%2 != 0:
        sum = ((W//2)+1)*((H//2)+1) + (W//2)*(H//2)

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

Submission status: Wrong Answer

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

if H%2 == 0:
    if W%2 == 0:
        sum = W*H/2
    elif W%2 != 0:
        sum = ((W//2)+1)*(H//2) + (W//2)*(H//2)
elif H%2 != 0:
    if W%2 == 0:
        sum = ((W//2))*((H//2)+1) + (W//2)*(H//2)
    elif W%2 != 0:
        sum = ((W//2)+1)*((H//2)+1) + (W//2)*(H//2)

print(sum)

Submission status: Wrong Answer

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

if H%2 == 0:
    if W%2 == 0:
        sum = W*H/2
    elif W%2 != 0:
        sum = ((W//2)+1)*(H//2) + (W//2)*(H//2)
elif H%2 != 0:
    if W%2 == 0:
        sum = ((W//2)+1)*((H//2)) + (W//2)*(H//2)
    elif W%2 != 0:
        sum = ((W//2)+1)*((H//2)+1) + (W//2)*(H//2)

print(sum)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

area = h*w

ans = area//2
if area%2 == 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

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

def main(h,w):
    if w%2==0:
        yoko1=w//2
        yoko2=yoko1
    else:
        yoko1=w//2+1
        yoko2=yoko1-1
    if h%2==0:
        tate=h//2
        return (yoko1+yoko2)*tate
    else:
        tate=h//2
        return (yoko1+yoko2)*tate+yoko1

if __name__=='__main__':
    h,w=readinput()
    ans=main(h,w)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
#print(H,W)

#1,3,5...行目で塗れるマス
n_odd = (1+W)//2
#2.4,6...行目で塗れるマス
n_even = W//2

if H%2 == 0:
  ans = int((n_odd + n_even) * (H/2))
else:
  ans = int((n_odd + n_even) * (H-1)/2 + n_odd)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
h,w=map(int, input().split(" "))
if h * w % 2 == 0:
  print(h * w // 2)
else:
  print(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:
from math import ceil
a,b=map(int,input().split())
print(ceil((a*b)/2))

Submission status: Wrong Answer

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

if h==1 and w==1:
  print(1)
  exit()

ans=h*(w//2)

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


print(ans)

Submission status: Wrong Answer

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

if h==2 and w==2:
  print(2)
  exit()

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

Submission status: Wrong Answer

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

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

if H %2 == 0:
    tate = H/2
    ans = tate * W

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

Submission status: Wrong Answer

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

if H %2 == 0:
    tate = H/2
    ans = tate * W

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

Submission status: Wrong Answer

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

if H %2 == 0:
    tate = H/2
    ans = tate * W

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

Submission status: Wrong Answer

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

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

if w%2!=0:
    x,y = w//2 + 1, w-(w//2+1)
else:
    x = y = w//2
print(x*round(h/2) + y * h//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import math
from decimal import *

def main():
    h, w = input().split()
    h = Decimal(h)
    w = Decimal(w)
    print(math.ceil(h*w/Decimal("2")))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

import math

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = w//2+1
b = a-1
a += b

if h%2==0:
  print(a*h)
else:
  print(a*h-b)

Submission status: Wrong Answer

Solution code:
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

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

Submission status: Wrong Answer

Solution code:
h,w=[int(x) for x in 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:
def main(H, W):
    od = -(-W // 2)
    ev = W // 2
    ans = (od + ev) * (H // 2)
    if H % 2 == 1:
        ans += od
    return ans


if __name__ == "__main__":
    H, W = map(int, input().split())
    ans = main(H, W)
    print(ans)

Submission status: Wrong Answer

Solution code:
def main(H, W):
    return -(-H * W // 2)


if __name__ == "__main__":
    H, W = map(int, input().split())
    ans = main(H, W)
    print(ans)

Submission status: Wrong Answer

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

ansew = x * y

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

Submission status: Wrong Answer

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

    if H == 1 or W == 1:
        return 1

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

    return ans

print(main())

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

    if H == 1 or W == 1:
        return 1

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

    return ans

print(main())

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())
w1 = int(w/2)
h1 = int(h/2)
w2 = int(w/2)
h2 = int(h/2)
if ( w % 2 != 0 ):
  w1 += 1
if ( h % 2 != 0 ):
  h1 += 1
res = h1 * w1 + h2 * w2
print(res)

Submission status: Wrong Answer

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

    return ans

print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
[H,W] = list(map(int,input().split(' ')))
import math
K = math.ceil(H*W)
if H==1 or W==1:print(1)
else:print(K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = [int(i) for i in input().split()]
    if (H * W) % 2 == 0:
        print(format(H * W // 2, "d"))
    else:
        print(format((H * W // 2) + 1, "d"))


resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

h = H // 2
w = W // 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
tate,yoko = map(int,input().split())

if yoko%2 == 0:
    print(int((tate*yoko/2)))
else:
    print(int((tate*(yoko-1)/2 + math.ceil(tate/2))))

Submission status: Wrong Answer

Solution code:
tate,yoko = map(int,input().split())

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

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) // 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 + 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:
h,w = map(int,input().split())

if h % 2 == 0:
    i = h // 2
else:
    i = h // 2 + 1

j = w // 2

if w % 2 == 0:
    print(h * j)
else:
    print(h * j + i)

Submission status: Wrong Answer

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

if l % 2 == 0:
    print(l // 2)
else:
    print(l // 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:
h,w = map(int,input().split())

if h % 2 == 0:
    h = h // 2
else:
    h = h // 2 + 1

if w % 2 == 0:
    w = w // 2
else:
    w = w // 2 + 1

print(h * w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import math

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

Submission status: Wrong Answer

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

print((H*W)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    h,w = map(int, input().split())
    n = h*w
    if h%2 == 0 or w%2 ==0:
        print(n//2)
    else:
        print(n//2+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    h,w = map(int, input().split())
    n = h*w
    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())
if H %2 == 0 or W % 2 == 0:
  print(H*W//2)
else:
  if H == 1 or W == 1:
    print(1)
  else:
    print(H*W//2+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h==1 or w==1:
    print(0)
else:
    q,r = divmod(h*w, 2)
    print(q+r)

Submission status: Wrong Answer

Solution code:
# B - Bishop

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

ans = 0
ans += W * (H//2)

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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