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

if h == 1 or w == 1:
    print(1)
else:
    H = (h+1)//2
    W = (w+1)//2

    print(H*W + (h-H)*(w-W))

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

Submission status: Wrong Answer

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

Hm2 = H % 2
Wm2 = W % 2
if Hm2==0 and Wm2==0:
    ans=H*W//2
elif Hm2==1 and Wm2==1:
    r=(W+1)//2
    ans=W*(H-1)//2+r
else:
    if Hm2==0:
        even=H
        odd=W
    else:
        even=W
        odd=H
    
    ans=odd*even//2
print(ans)

Submission status: Wrong Answer

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

if h % 2 == 1:
    ch1 = math.ceil(h/2)
    ch2 = ch1 - 1 
else:
    ch1 = h//2
    ch2 = ch1

if w % 2 == 1:
    ans = ch1 * math.ceil(w / 2) + ch2 *  math.floor(w / 2)
else:
    ans = ch1 * (w // 2) + ch2 * (w // 2)
    
print(int(ans))

Submission status: Wrong Answer

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

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

        ans += r

print(ans)

Submission status: Wrong Answer

Solution code:
H, M = map(int,input().split())
l = [H, M]

max = max(l)
min = min(l)

if max == min:
  if max % 2 == 0:
    N = (H * M) / 2
  else:
    N = (((H * M) - 1)/2)+1

else:
  r = max - min
  r2 = max - r
  r3 = r * min
  if r2 % 2 == 0:
    n1 = (r2 * r2) / 2
  else:
    n1 = (((r2 * r2) - 1)/2)+1
 
  if r3 % 2 == 0:
    n2 = r3 / 2
  else:
    n2 = (r3 - 1) / 2

  N = n1 + n2

print(N)

Submission status: Wrong Answer

Solution code:
A=input().split()
H=int(A[0])
W=int(A[1])
if (W%2==1) and (H%2==1):
    R=(W+1)*H/2-(H-1)/2
else:
    R=H*W/2
print(int(R))

Submission status: Wrong Answer

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

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

print(a)

Submission status: Wrong Answer

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

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

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


    print(a+b)
else:

    print(h*w//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def countSquares(row, column): 
      
    # Count top left squares 
    topLeft = min(row, column) - 1
      
    # Count bottom right squares 
    bottomRight = 8 - max(row, column) 
      
    # Count top right squares 
    topRight = min(row, 9-column) -1
      
    # Count bottom left squares 
    bottomLeft = 8 - max(row, 9-column)  
  
      
    # Return total count 
    return (topLeft + topRight + bottomRight + bottomLeft) 
  

  
row, column = [int(x) for x in input().split()]
print(countSquares(row, column))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = int(H/2)  #3
y = H%2  #1

z = int(W*x)  # 3

num = z + int((W+1)/2)*y   #

"""""""""
print('x: ' + str(x))
print('y: ' + str(y))
print('z: ' + str(z))
print('num: ' + str(num))

print()

#print(H)
#print(W)
"""""

print(int(num))

Submission status: Wrong Answer

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

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

ans=int(ans)
print(ans)

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

Submission status: Wrong Answer

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

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())
    print(math.ceil(Decimal(h) * Decimal(w) / Decimal(2)))


main()

Submission status: Wrong Answer

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

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

ans = 0

if H == 1 or W == 1:
    ans = 1

HW = H * W

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = list(map(int,input().split()))
 
a = inp[0]*inp[1]

if (inp[0]==1 or inp[1]==1):
    print("1")
else:
    if (a %2 == 1):
        b = int(a/2)+1
        print(b)
    else:
        b = a/2
        print(b)

Submission status: Wrong Answer

Solution code:
import math

h, w = input().split()

h, w = int(h), int(w)

if (h == 1) or (w == 1):
  print(1)
else:
  print(math.ceil(max([h, w]) / 2) * math.ceil(min([h, w]) / 2) + (max([h, w]) // 2) * min([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())

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

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

print(h1 * w1 + h2 * w2)

Submission status: Wrong Answer

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

print(math.ceil(i[0] * i[1] / 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if H==1 or W==1:
    ans = 0

elif H%2==0 or W%2==0:
    ans = H*W // 2 

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
high, wigh = map(int,input().split())

if high % 2 == 1:
    if wigh % 2 == 1:
        print(round(high * wigh/2 + 0.5))
    else:
        print(round(high * wigh/2))
else:
    print(round(high * wigh/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math
#input = sys.stdin.buffer.readline

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

a,b = inn()
l=math.floor(a/2)+a%2
k=math.floor(a/2)
q=math.floor(b/2)+b%2
w=math.floor(b/2)
print(l*q+k*w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l=input().split(" ")
a=int(l[0])
b=int(l[1])
 
print((a*b+1)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(a + b)

Submission status: Wrong Answer

Solution code:
import math
input = input().split(" ")
h = int(input[0])
w = int(input[1])
mult = h*w
res = math.ceil(mult / 2)
print(res)

Submission status: Wrong Answer

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    (h, w) = tuple(map(int, input().split()))
    ans = 0
    if h % 2 == 0:
        ans = h * w // 2
    else:
        ans = (h - 1) * w // 2
        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())
count = 0

#１,３,５...
s = math.ceil(w/2)
#2,4,6..
t = math.floor(w/2)

g = s+t


if(w == 1):
    count = 0
elif(h%2 != 0):
    count =  (math.floor(h/2)) * g + s
elif(h%2 == 0):
    count = (h/2) * g



print(int(count))

Submission status: Wrong Answer

Solution code:
import math
H,W = input().split()
Hnum = int(H)
Wnum = int(W)
counter = 0
tmp = 0
if Hnum%2 == 0:
    counter = int(Hnum/2 * Wnum)
else:
    tmp = math.ceil(Wnum/2)
    Hnum -=1        
    counter = int((Hnum/2 * Wnum) +tmp)

print(counter)

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
K = 0
L = 0
#条件分岐
#H = 奇数 W = 奇数
if H%2 == 1 and W%2 == 1:
    K = (H//2+1)*(W//2+1)
    L = (H//2)*(W//2)
#H = 奇数 W = 偶数
elif H%2 == 1 and W%2 == 0:
    K = (H//2+1)*(W//2)
    L = (H//2)*(W//2)
#H = 偶数 W = 奇数
elif H%2 == 0 and W%2 == 1:
    K = (H//2)*(W//2+1)
    L = (H//2)*(W//2)
else:
    K = H*(W//2)
    L = 0
print(K+L)

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 = list(map(int, input().split()))
tile = h*w
ans = (tile+1)//2
            
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b = map(int, input().split())
    m = a*b
    r=-(-m//2)
    # if m%2 == 0:
    #     print(r)
    # else:
        # print(r+1)
    print(r)

resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

r = int((a*b)/2)

if a%2 == 0 or b%2 == 0:
    print(r)
else:
    print(r+1)

Submission status: Wrong Answer

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

H = int(i[0])
W = int(i[1])

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for h in range(1, H + 1):
    ans += (W + h % 2) // 2

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

for line in sys.stdin:
	a,b=map(int,line.split())
	if(a*b%2==0):
		print(int(a*b/2))
	else:
		count = 0
		for i in range(7):
			if(i%2==0):
				count+=math.ceil(b/2)
			else:
				count+=math.floor(b/2)
		print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, W = [int(i) for i in input().split()]
h1 = (H + 1) // 2 
w1 = (W + 1) // 2
h2 = H // 2
w2 = W // 2
print(h1*w1+h2*w2)

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

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

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

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:
        count = w
    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:
import math
h,w=map(int,input().split())
d,m=divmod(h,2)
if h == 1:
  print(1)
  exit()
print(d*(math.ceil(w/2)+math.floor(w/2))+math.ceil(w/2)*m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = th*tw + int(h/2)*int(w/2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
a,b=map(int,input().split())
if(a==1 or b==1):
    print('1')
if(a%2==0):
    a//=2
    print(a*b)
elif(b%2==0):
    b//=2
    print(a*b)
else:
    print(a*b//2+(a*b)%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:
#B
import math
h,w=map(int,input().split())
if h==1 or w==1:
    print(0)
elif h%2==0 and w%2==0:
    print(int(h*w/2))
elif h%2==0 and w%2!=0:
    print(int(h*(w-1)/2+math.floor(h/2)))
elif h%2!=0 and w%2==0:
    print(int(w*(h-1)/2+math.floor(w/2)))
else:
    print(int((w-1)*(h-1)/2+math.floor(h/2)+math.floor(w/2)+1))

Submission status: Wrong Answer

Solution code:
l=input().split(" ")
a=int(l[0])
b=int(l[1])

print((a*b+1)/2)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
h, w = map(int, input().split(' '))
ans = h * w
if (ans % 2 == 1):
    print(ans // 2 + 1)
elif(ans % 2 == 0):
    print(ans // 2)

Submission status: Wrong Answer

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

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

elif a == 0 and b != 0:
    if b % 2 == 1:
        print(b // 2 + 1)
    else:
        print(b // 2)

elif a != 0 and b == 0:
    if a % 2 == 1:
        print(a // 2 + 1)
    else:
        print(a // 2)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

x = int(H/2)  #3
y = H%2  #1

z = int((W+1)/2) + int(W/2)  # 3

num = z*x + int((W+1)/2)*y   #

"""""""""
print('x: ' + str(x))
print('y: ' + str(y))
print('z: ' + str(z))
print('num: ' + str(num))

print()

#print(H)
#print(W)
"""""

print(int(num))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
from decimal import *
s = input().split()
t = [int(p) for p in s]

#print(t)
if( Decimal(Decimal(t[0]) % 2 )== 1 and Decimal(Decimal(t[1]) % 2) == 1):
    n = Decimal( Decimal(Decimal(t[0]) - 1) / 2  )
    #print(n)
    m = Decimal( Decimal(Decimal(t[1]) - 1) / 2  )
    answer = Decimal(    Decimal(  Decimal(Decimal(m) + 1)     *    Decimal(Decimal(n) + 1)  )   + Decimal( Decimal(m) * Decimal(n) )       )
else:
    answer = Decimal(   Decimal(Decimal(t[0]) * Decimal(t[1])) / 2  )

print(int(answer))

Submission status: Wrong Answer

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

if h % 2 == 1:
    ch1 = math.ceil(h/2)
    ch2 = ch1 - 1 
else:
    ch1 = h//2
    ch2 = ch1

print(ch1, ch2)
if w % 2 == 1:
    ans = ch1 * math.ceil(w / 2) + ch2 *  math.floor(w / 2)
else:
    ans = (ch1 + ch2) * (w // 2)
print(int(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


main()

Submission status: Wrong Answer

Solution code:
import math

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

if H == 1:
    print(1)

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N , M = (map(int , input().split()))
a = N*M
ans = -(-a//2)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

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
HW = input()
H, W = int(HW.split()[0]), int(HW.split()[1])
t = float(H*W)/4.0
t = t*2.0
print(ceil(t))

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
H = a[0]
W = a[1]

if H % 2 == 0:
    print(round(W/2 * H))

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

Submission status: Wrong Answer

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

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

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

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

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