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:
a,b = map(int,input().split())
c = a * b
if c == 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:
import numpy as np
import sys
h,w = map(int,input().split())
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:
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())
counts = 0

even = (w // 2 + 1)
odd = (w // 2)

counts += even * (h // 2)
counts += odd * (h // 2)
if h % 2 != 0:
    counts += even

print(counts)

Submission status: Wrong Answer

Solution code:
def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n, m = mi()

ans = n*m
print((ans+1)//2)

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
if H == 1 or W == 1:
  print(0)
  exit()
ans = 0
if W % 2 == 0:
    f, n = W // 2, W // 2
else:
    f = math.ceil(W / 2)
    n = f - 1
if H % 2 == 0:
    kakeru = H // 2
    ans += f * kakeru + n * kakeru
else:
    kakeru = H // 2
    n_kakeru = H - (H // 2)
    ans += f * n_kakeru + n * kakeru
print(ans)

Submission status: Wrong Answer

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

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(t[0] % 2 == 1 and 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:
v, h = map(int,input().split())
ans = (v*h)//2
print(ans)

Submission status: Wrong Answer

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

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

print(int(x))

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
print(c * (a + b) + d * a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())
m,n,p,q = H//2, W//2, H%2, W%2
print(2*m*n+m*q+n*p+p*q)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

ans = math.ceil((h*w)/2)

print(int(ans))

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:
HW = input().split()
H = int(HW[0])
W = int(HW[1])
print(round((H*W+H*W%2)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
x = list( map(int, input().split()) )
h = x[0]
w = x[1]

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

Submission status: Wrong Answer

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

import sys


def LI():
    return list(map(int, sys.stdin.buffer.readline().split()))


def I():
    return int(sys.stdin.buffer.readline())


def LS():
    return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()


def S():
    return sys.stdin.buffer.readline().rstrip().decode('utf-8')


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


def SRL(n):
    return [list(S()) for i in range(n)]


def MSRL(n):
    return [[int(j) for j in list(S())] for i in range(n)]

# ----------------------------------------------------------------


def main():
    h, w = LI()
    if h % 2 == 0 or w % 2 == 0:
        print(int((w * h / 2)))
    else:
        print(int((h * w + 1) / 2))


main()

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
h = a[0]
w = a[1]
print(a)
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:
H,W = list(map(int,input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a,b = list(map(int,input().split()))
if a*b%2==0:
    d = int(a*b/2)
else:
    d = int((a*b+1)/2)
print(Decimal(d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = (int(i) for i in input().split())

q_h,mod_h = divmod(h,2)

if h == 1:
	print(1)
elif mod_h == 0: 	
	print(w * q_h)
else:
	q_w,mod_w = divmod(w,2)
	if mod_w == 0:
		print(w * q_h + q_w)
	else:
		print(w * q_h + q_w + 1)

Submission status: Wrong Answer

Solution code:
import math                        
                                   
w, h = map(int, input().split(' '))
if w % 2 == 1 and h % 2 == 1:      
    t = math.floor(w * h / 2)      
    n = t + 1                      
else:                              
    n = (w * h) / 2                
print(int(n))

Submission status: Wrong Answer

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

ans = int((W // 2) * H)

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

print(int(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import bisect,collections,itertools,math,numpy,string
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
##################################################
def main(H,W):
    if H==W==1:
        return 1
    elif H==1:
        if W%2==0:
            return W//2
        else:
            return W//2 +1
    elif W==1:
        if H%2==0:
            return H//2
        else:
            return H//2 +1
    elif H%2==0 and W%2==0:
        return (H*W)//2
    elif H%2==0 and W%2==1:
        return (H//2)*(2*(W//2)+1)
    elif H%2==1 and W%2==0:
        return (2*(H//2)+1)*(W//2)
    else:
        return (H//2)*(2*(W//2)+1)+((W//2)+1)
    return _HW
    
H,W = LI()
print(main(H,W))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, 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 r % 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(int(N))

Submission status: Wrong Answer

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

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
H, W = [int(x) for x in 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:
from math import ceil
l = [int(j) for j in input().split()]
if l[0]==1 or l[1]==1:
    print(1)
elif l[0]<l[1]:
    print(int(l[0]*l[1]/2))
else:
    print(ceil(l[0]*l[1]/2))

Submission status: Wrong Answer

Solution code:
def main():
    h,w = map(int,input().split())
    #奇数の段は1,3,5...の奇数列目に
    #偶数の段は2,4,6...の偶数列目に移動可能
    kisuu_dan = h//2
    gusuu_dan = h//2
    if h % 2 != 0:
        kisuu_dan += 1
    kisuu_retsu = w//2
    gusuu_retsu = w//2
    if w % 2 != 0:
        kisuu_retsu += 1
    print(kisuu_dan * kisuu_retsu + gusuu_dan * gusuu_retsu)






if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def can_move(H, W):
    if W == 0:
        return 0
    masu = H * W
    return int((masu / 2) + (masu % 2))

print(can_move(H, W))

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if H*W <= 2 :
  print (1)
  exit()

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

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

Submission status: Wrong Answer

Solution code:
import math

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

yoko = int(math.floor(W/2+0.5))
tate = int(math.floor(H/2+0.5))

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

print(int(result))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

if (int(h) % 2) == 0:
    tate = int(h) // 2
    flag_h = True
else:
    tate = int(h) // 2 + 1
    flag_h = False

if (int(w) % 2) == 0:
    yoko = int(w) // 2
    flag_w = True
else:
    yoko = int(w) // 2 + 1
    flag_w = False

if flag_h:
    count = int(w) * tate
else:
    count = int(w) * (tate - 1) + yoko

print(count)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
a = W // 2
b = W % 2

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

Submission status: Wrong Answer

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


mm2 = W//2
mm4 = H//2

mm1 = ((H)//2)*(W%2)
mm3 = ((W)//2)*(H%2)
mm5 = H*W%2

print(2*mm2*mm4+mm1+mm3+mm5)
# print(mm2,mm4,mm1,mm3)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

if H == W:  # 正方形
    if H % 2 == 0:  # HとWが偶数
        ans = H * W // 2
    else:
        ans = (H * W + 1) // 2
else:  # 長方形
    if (H % 2 == 0) and (W % 2 == 0):  # 両方偶数
        ans = H * W // 2
    elif (H % 2 == 1) and (W % 2 == 1):  # 両者奇数
        ans = (H * W + 1) // 2
    else:  # 奇数と偶数、偶数と奇数
        ans = H * W // 2
print(ans)

Submission status: Wrong Answer

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

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

if w%2 == 0:
  w__ = w_*2
else:
  w__ = w_*2-1

if h%2 == 0:
  print((w__)*(h//2))
else:
  print((w__)*(h//2)+w_)

Submission status: Wrong Answer

Solution code:
#B
import math
h,w=map(int,input().split())
if h==w==1:
    print(0)
elif h%2==0 and w%2==0:
    print(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:
import sys
import math
a = input().split()
#print(a)

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

c = H * W
if c % 2 == 1:
  c = math.floor(c / 2) + 1
else:
  c = math.floor(c / 2)

print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(int(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

is_odd_h = False
is_odd_w = False

if h % 2 == 0:
     pass
else:
     is_odd_h = True

if w % 2 == 0:
     pass
else:
     is_odd_w = True

if is_odd_h and is_odd_w:
    ans = math.ceil(h * w / 2)
else:
    ans = h * w / 2

print(int(ans))

Submission status: Wrong Answer

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


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split(" ")))
h = x[0]
w = x[1]

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

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:
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(2 * H * W)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import re

l = sys.stdin.readline()
l = l.split(' ')
l = [int(str) for str in l]

h = l[0]
w = l[1]

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

print(out)
sys.stdout.flush()

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
ans = 0
wx = W // 2
hx = H // 2
wy = W % 2
hy = H % 2

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

if wy == 0 and hy == 0:
  ans = (W * H) / 2
elif wy == 1 and hy == 0:
  ans = (((W-1)*H)/2) + (H / 2)
elif wy == 0 and hy == 1:
  ans = ((W*(H-1))/2) + (W / 2)
else:
  ans = (((W-1)*(H-1))/2) + ((W-1) / 2) + ((H-1) / 2) + 1
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


mm2 = W//2
mm4 = H//2

mm1 = ((H)//2)*(W%2)
mm3 = ((W)//2)*(H%2)
mm5 = H*W%2

# print(2*mm2*mm4+mm1+mm3+mm5)
print(mm2,mm4,mm1,mm3)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(n + m)

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 or w % 2 ==0:
  print(h * w / 2)
else:
  print(math.ceil(h * w / 2))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import time
start_time = time.time()
from sys import stdin, stdout 
from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
from fractions import Fraction as frac
from random import random
cin = stdin.readline
def cout(x):    stdout.write(str(x)+'\n')
def var(type = int):    return type(stdin.readline())                      #   take input
def readline(type = int):   return map(type,stdin.readline().split())      #   read line into multiple variables
def readlist(type = int):   return list(map(type,stdin.readline().split()))
def sorted_indexes(arr):    return sorted(range(len(arr)),key=arr.__getitem__)
def printr(arr):    [stdout.write(str(x)+' ')   for x in arr];    cout('')
def find_lt(a, x):#'Find rightmost value less than x'
    i = bisect_left(a, x)
    if i:
        return a[i-1]
    raise ValueError
def find_gt(a, x):#'Find leftmost value greater than x'
    i = bisect_right(a, x)
    if i != len(a):
        return a[i]
    raise ValueError
def f_primes(n) :
    pmx = [] ; f = 1
    for k in range(2, n):
        f = f * (k - 1)
        if ((f + 1) % k == 0):  pmx.append(k)
    return pmx
def hypo(x,y):  return math.sqrt(x*x + y*y)
def binary_search(arr, x):
    i = bisect_left(arr, x)
    if i == len(arr) or arr[i] != x:
        return -1
    return i
    
def binary_string(x):   return '{:032b}'.format(x)
MOD1 = 1000000007; MOD2 = 998244353

#----------------Funcs


v, h = map(int,input().split())
ans = int(math.ceil(h/2)*math.ceil(v/2) + math.floor(h/2)*math.floor(v/2))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
arg = input().split(' ')
H = int(arg[0])
W = int(arg[1])

w_odd = W // 2 if W % 2 == 0 else W // 2 + 1
w_even = W // 2

reachable = w_odd * ((H+1) // 2) + w_even * H // 2
print(reachable)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if w%2 == 0:
  w__ = w_*2
else:
  w__ = w*2-1

if h%2 == 0:
  print((w__)*(h//2))
else:
  print((w__)*(h//2)+w_)

Submission status: Wrong Answer

Solution code:
hei,wid=map(int,input().split())
s=0
s+=hei*wid
if s%2==0:
    print(s//2)
elif (hei==1 and wid>=1) or (hei>=1 and wid==1):
    print(1)
elif s%2!=0:
    print(s//2+1)
else:
    print(0)

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import heapq
import collections
import itertools
sys.setrecursionlimit(100001)

# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

# n, m = map(int, input().split())

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

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

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
ans += -(-w//2) * -(-h//2)
ans += -(-(h-1)//2) * -(-(w-1)//2)
print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def main():

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

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

    print(int(result))


if __name__ == '__main__':
    main()