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

tmpH=0
tmpHamari = w%2
if tmpHamari==1:
    tmpH=int(w/2)+1
else:
    tmpH=int(w/2)

tmpWamari = h%2
bigW = int(h/2)
smallW = int(h/2)
if tmpWamari==1:
    bigW+=1


print((tmpH*bigW) + ((tmpH-1)*smallW))

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())


H,W=acinput()

if W%2==0:
    res=(H/2)*W
else:
    res = H*(W//2)+H//2+H%2
    #print(H//2)
    

print(int(res))

Submission status: Wrong Answer

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

N1 = min(H, W)
N2 = max(H, W)

if N1 % 2 == 0:
  count = (N1 * N2) // 2
else:
  count = (N1 * (N1 - 1) + N1 + 1) // 2
  if N2 - N1 % 2 == 0:
    count += (N1 * (N2 - N1)) // 2
  else:
    count += (N1 * (N2 - N1 - 1) + N1 - 1) // 2

print(count)

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:
#python3
from math import floor
def main():
    h, w = map(int, input().split())
    if h == 1 or w == 1:
        print(1)
        return
    ans = 0
    if h%2 == 0:
        ans = h//2 * w 
    else:
        ans =((h+1)//2)*((w+1)//2)+(((h+1)//2)-1)*(((w+1)//2)-1)
    print(ans)
main()

Submission status: Wrong Answer

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

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

if H % 2 == 1:
    ans += W // 2

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
value = input().split()
rows = int(value[0])
colmuns = int(value[1])
OddColNum = colmuns // 2 
EvenColNum = OddColNum
if (colmuns % 2) != 0:
  OddColNum = OddColNum + 1
if (colmuns == 1):
  OddColNum = 1

OddRowCount = 0
EvenRowCount = rows // 2
if (rows % 2) == 0:
  OddRowCount = rows // 2
else:
  OddRowCount = (rows // 2) + 1
if (rows == 1):
  OddRowCount = 1

#print(OddColNum)
#print(EvenColNum)
#print(OddRowCount)
#print(EvenRowCount)
counts = OddRowCount * OddColNum + EvenColNum * EvenRowCount
print(counts)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if h%2 == 0 or w%2 == 0:
    if h%2 == 0:
        result = (h//2) * w
        print(round(result))
    else:
        result = (w//2) * h
        print(round(result))
else:
    result = h//2 * (w//2) + (h - h//2) * (w - w//2)
    print(round(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
str=input().split(" ")

a= int(str[0])
b=int(str[1])
c=a*b
if c%2 == int(0):
    print(c/2)
else:
    print(int(c/2+1))

Submission status: Wrong Answer

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

R = (H * W + 1) // 2

print(R)

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    # print(int((H/2)*W) if H%2==0 else int((H//2)*W+math.ceil(W/2)))
    if H == 1:
        print(1)
        return
    print(math.ceil(H*W/2))
    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%2 != 0:
    if b%2 != 0:
        if a > b:
            print(int((-(-a//2))+(a*(b-1)/2)))
        else:
            print(int((-(-a//2))+(a*(b-1)/2)))
    else:
        print(int(a*b/2))
else:
    print(int(a*b/2))

Submission status: Wrong Answer

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

print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, v = input().split(' ')
h = int(h)
v = int(v)
hr = int((h-1)/2) + 1
vrP = (int((v-1)/2) + 1) * hr
vpN = 0
if h % 2 == 0:
    vrN = (int(v / 2)) * hr
else:
    vrN = (int(v / 2)) * (hr-1)

if h ==0 or v == 0:
    print(0)
else:
    print(int(vrP + vrN))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

h, w = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = h*w

if num % 2 == 1:
    print((num+1)//2)
elif num == 1:
    print(1)
else:
    print(num//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:
from collections import deque, defaultdict, Counter
from math import ceil, floor
import sys
def input():
    return sys.stdin.readline().strip()

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

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

if H > W:
    H, W = W, H

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

Submission status: Wrong Answer

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

ans = a * b

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if (w == 1 or h == 1):
    print(1)
elif (w > h):
    print((h*(h+1))//2)
elif (h > w):
    print((w*(h//2))+2)
else:
    print(math.ceil((h*w)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
import math
def bishop(h,w):
    if h == 1:
        ans = 1
    else:
        ans = int(w/2)*h + (w%2)*math.ceil(h/2)
    return ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % 2 == 0 or b % 2 == 0:
  print(a * b // 2)
  
if a % 2 == 1 and b % 2 == 1:
  ans = a * (b //2) + (a + 1) //2
  print(ans)
  
if a == 1 or b == 1:
  ans1 = (a * b + 1) //2
  print(ans1)

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

# num = H * W

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

elif 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:
    if H == 3 or W == 3:
        ans = max(H, W)
        print(ans + (ans-ans//2))
    else:
        num = H // 2
        ans = num * W
        print(ans + (H-(num)))

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split()); c = 0 ; a = 0; A = 0; B = 0
import math

if h % 2 == 0:
    for i in range(1,h+1):
        if i % 2 == 0:
            a += 1
    c = a * w
    

else:
    for i in range(1,h+1):
        if i % 2 != 0:
            a += 1
    if w % 2 != 0:
        c = a * w - w/2 + 0.5
        c = round(c)
    else:
        c = a * w - w/2
        c = round(c)
        

print(c)

Submission status: Wrong Answer

Solution code:
s = input()
h = int(s[0])
w = int(s[2])

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

Submission status: Wrong Answer

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

if a%2==0:
    ans=(a//2)*b
else:
    na=a+1
    ans=((na//2)*b)-(b//2)
    
if a<=2 and b<=2:
    ans=0
    
if a==2 and b==2:
    ans=2
    
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if (w > h):
    print((h*(h+1))//2)
elif (h > w):
    print((w*(h//2))+2)
else:
    print(math.ceil((h*w)/2))

Submission status: Wrong Answer

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

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:
# coding: utf-8
H,W = list(map(int,input().split()))
ans = H*W/2
if H*W%2==1:
    ans+=1
print("{:.0f}".format(ans))

Submission status: Wrong Answer

Solution code:
import sys
import math
from decimal import *
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    h, w = map(int, input().split())
    a = math.ceil(h / 2)
    b = h - a
    c = math.ceil(w / 2)
    d = w - c
    ans = a * c + b * d
    print(ans)


main()

Submission status: Wrong Answer

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

h_num, h_m = divmod(h, 2)
w_num, w_m = divmod(w, 2)

ans = 2 * h_num * w_num
if h_m == 1 and w_m == 1:
    ans += h_num + w_num + 1
elif h_m == 1:
    ans += w_num
elif w_m == 1:
    ans += h_num

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2
w_b = w // 2

if((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
datas = input().split(" ")

h = int(datas[0])
w = int(datas[1])


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

Submission status: Wrong Answer

Solution code:
import math
m,n = map(int,input().strip().split())
print(math.ceil((m*n)/2))

Submission status: Wrong Answer

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

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

H, W = map(int, input().split())
h_even= H//2
h_odd= H-h_even
w_even= W//2
w_odd= W-w_even


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

# if H%2==1 or W%2==1:
#     print(h_odd*w_odd+h_even*w_even-1)
# else:
#     print(h_odd*w_odd+h_even*w_even)
print(h_odd*w_odd+h_even*w_even)

Submission status: Wrong Answer

Solution code:
k = input()

h, w = k.split(' ')

r = int(h) * int(w)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
if m==1 and n==1:
  print(1)
elif m==1 or n==1:
  print(0)
elif m%2==1:
    max1=m//2+1
    min1=m//2
    res=max1*((n+1)//2)+min1*(n//2)
    print(res)
else:
    print(n*(m//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    print(count)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
a = [int(x) for x in input().split(" ")]
if a[1] == 0 or a[0] == 1:
  print(0)
  exit()
kisu = a[0] // 2 if a[0] % 2 == 0 else a[0] // 2 + 1
gusu = a[0] // 2
yokokisu = a[1] // 2 if a[1] % 2 == 0 else a[1] // 2 + 1
yokogusu = a[1] // 2
ans = kisu * yokokisu + gusu * yokogusu
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

w1 = w2 = 0
if w % 2 == 0:
    w1 = w / 2
    w2 = w / 2
else:
    w1 = (w + 1) / 2
    w2 = w / 2

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
x,y = map(int, input().split())
tot = x*y

if x%2==1 and y%2==1:
    tot = (tot+1)/2
else:
    tot = tot/2
print(math.floor(tot))

Submission status: Wrong Answer

Solution code:
import math

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



if h%2==1 and w%2==1:

    a = (h//2) * w
    b = math.ceil(w/2)

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

    print(a+b)

elif h%2==0 and w%2==1:
    a = (w//2) * h
    b = h//2

    print(a+b)

else:
    print(h*w//2)

Submission status: Wrong Answer

Solution code:

H , W = input().split()
W = int(W)
H = int(H)
ans = int(0)

#Wが偶数なら(W//2)*H
#W.Hが奇数なら((W+1)//2)*((H+1)//2) + ((W - 1)//2*(H - 1)//2)
#Wが奇数Hが偶数(W+1)//2*(H//2) + ((W - 1)//2)*(H//2)

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

Submission status: Wrong Answer

Solution code:

n, m=map(int,input().split())
ans = n*m//2
if n*m%2!=0:
  ans += 1
print(int(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def result(h, w):

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


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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
if H==1:
    print(1)
elif W==1:
    print(1)
elif H==W and (H%2)==1:
    
    print(int(-(-(H*W)//2)))
elif H!=W:
    mas=-(-W//2)
    nextmas=mas-1
    Set=int(H/2)
    amari=H%2


    num=(mas+nextmas)*Set

    num+=mas*amari

    print(int(num))
else:
    mas=-(-W//2)
    num=mas*H
    print(num)

Submission status: Wrong Answer

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

if H == 1 and W == 1:
  c = 1
else:
  if H % 2 == 0:
    h_1 = H / 2
    h_2 = H / 2
  else:
    h_1 = math.ceil(H / 2)
    h_2 = H - h_1

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

print(int(c))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
bishop = W * H
div, mod = divmod(bishop, 2)
print(div + mod)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

a = H * W
b = 0

print(math.ceil(a/2))

Submission status: Wrong Answer

Solution code:
s = input()
h = int(s[0])
w = int(s[2])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = h * w

if n % 2 == 0:
    print(int(n / 2))
else:
    print(int(-(-n // 2)))

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

Submission status: Wrong Answer

Solution code:
line = raw_input()
#print(line)
line = line.split(' ')
a = int(line[0])
b = int(line[1])

x = (a + 1) // 2
y = a // 2

print(x * ((b + 1) // 2) + y * (b // 2))

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

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) + int(H*(W-1)/2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
hw = input('')
h = int(hw.split(' ')[0])
w = int(hw.split(' ')[1])
if h == 1:
  result = 1
elif w == 1:
  result = 1
else:
  if h%2 == 0:
    if w%2 == 0:
      # 縦偶数ｘ横偶数
      result = w // 2  * h 
    else:
      # 縦偶数ｘ横奇数
      result = (w//2 + 1) * h//2 + (w//2 * h//2)
  else:
    if w%2 == 0:
      # 縦奇数ｘ横偶数
      result = (w//2) * h
    else:
      # 縦奇数ｘ横奇数
      result = (w//2 + 1) * (h//2+1) + (w//2 * h//2)
print(result)

Submission status: Wrong Answer

Solution code:
N = list(map(int, input().split()))
print((N[0]*N[1]+1)//2)

Submission status: Wrong Answer

Solution code:
h, v = input().split(' ')
h = int(h)
v = int(v)
hr = int((h-1)/2) + 1
vrP = (int((v-1)/2) + 1) * hr
vpN = 0
if h % 2 == 0:
    vrN = (int(v / 2)) * hr
else:
    vrN = (int(v / 2)) * (hr-1)

print(int(vrP + vrN))

Submission status: Wrong Answer

Solution code:

n,w = map(float, input().split())

if n % 2 == 0 or w % 2 == 0:
    ans = (n * w) / 2.
    ans = int(ans)

else : ans = int((n * w) / 2.) + 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3 ## -*- python -*-

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

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

print(x)

Submission status: Wrong Answer

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


block = H//2 * W
tip = W//2 if W%2==0 else W//2+1
tip = tip if H%2!=0 else 0


ans = block+tip
print(ans)

Submission status: Wrong Answer

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

if w % 2 == 0:
  count = int(w / 2) * h
else:
  c1 = int(math.ceil(w / 2))
  c2 = int(math.floor(w / 2))
  if h % 2 == 0:
    count = (c1 + c2) * int(h / 2)
  else:
    count = (c1 + c2) * int(math.floor(h / 2)) + c1
print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % 2 == 0 or b % 2 == 0:
  print(a * b // 2)
  
if a % 2 == 1 and b % 2 == 1:
  ans = a * (b //2) + (a + 1) //2
  print(ans)
  
if a == 1 or b == 1:
  ans = a * b - 1
  print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
A,B=(int(x) for x in input().split())
a = int(A) % 2
b = int(B) % 2

if  int(a) != 0 and int(b) != 0:
    mod = (int(A)*int(B)) % 2
    n = ((int(A) * int(B)) // 2) + int(mod)

    print(n)
else :
    n = (int(A) * int(B)) //2
    print(n)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_CEILING

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

ans = Decimal(H * W / 2)
print(ans.to_integral_exact(rounding=ROUND_CEILING))

Submission status: Wrong Answer

Solution code:
import math
n = input().split()
k = int(n[0])*int(n[1])
if int(n[0]) == 1 or int(n[1]) == 1:
  print(0)
else:
  print(math.ceil(k/2))

Submission status: Wrong Answer

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

if H % 2 == 0:
    ans = (H / 2) * W
else:
    if W == 1:
        ans = ((H // 2) + 1)
    else:
        cal_low = W // 2
        cal_large = W - cal_low
        ans_low = ((H // 2)) * cal_low
        ans_large = ((H // 2) + 1) * cal_large
        ans = ans_low + ans_large

print(str(int(ans)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
datas = input().split(" ")

h = int(datas[0])
w = int(datas[1])


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

q, mod = divmod(H, 2)

if mod==0:
    A=q
else:
    A=q+1

q, mod = divmod(H-1, 2)

if mod==0:
    B=q
else:
    B=q+1


q, mod = divmod(W, 2)

if mod == 0:
    C = q*(A+B)
else:
    C = q*(A+B) + A


print(C)