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

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

Submission status: Wrong Answer

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

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:
    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:
from decimal import Decimal

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

ans=0
ans+=(W//2+W%2)*(H//2+H%2)
ans+=(W//2)*(H//2)
print(int(ans))

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

Submission status: Wrong Answer

Solution code:
h,w = [int(i) for i in 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 = input().split()
H = int(H)
W = int(W)

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

print(R)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
h = int(s[0])
w = int(s[2])
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())
h_even = h // 2
h_odd = h_even + (h % 2)
w_even = w // 2
w_odd = w_even + (w % 2)
print(h_even * w_even + h_odd * w_odd)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
input_line = input()
lines = input_line.split()
x=int(lines[0])
y=int(lines[1])
input_num=x*y
if(input_num%2==1):
  input_num=input_num+1
print(int(input_num/2))

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

if 1 <= H and W <= 10**9:
  out = H * W
  if out % 2 == 0:
     out = out/2
  else:
     out = ((out-1)/2)+1
  print(int(out))

Submission status: Wrong Answer

Solution code:
import sys
import math

for line in sys.stdin:
	a,b=map(int,line.split())
	if(a==1 or b==1):
		print(1)
	elif(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:
s = input()
h = int(s[0])
w = int(s[2])
r = (h*w+1) /2 if h %2 !=0 and w %2 !=0 else h*w/2
print(r)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
H , W = map  ( int , input().strip().split(" ") ) ; 
s1 = (  H //2 + H %2 ) * ( W //2  + W %2 ) ;
s2 = (  H //2  ) * ( W //2 ) ;
print ( s1 + s2 ) ;

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, getcontext
a, b = map(int, input().split())
getcontext().prec = 50
c = Decimal(a) * Decimal(b)
if c % 2 == 1:
    print(int(c/2)+1)
else:
    print(int(c/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
a,b = list(map(int,input().split()))
a = Decimal(a)
b = Decimal(b)
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())
 
A = H * W
 
if A % 2 == 0:
  print(A // 2)
else:
  print((A - 1) // 2 + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print((H * W + 1) // 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
from math import floor

N = [int(_) for _ in input().split()]

H, W = N[0], N[1]


def solve(H, W):
    acnt = floor(W / 2) + 1
    bcnt = W - acnt
    
    if H % 2 == 0:
        cnt = acnt * floor(H/2) + bcnt * floor(H/2)
    else:
        cnt = acnt * (floor(H/2) + 1) + bcnt * floor(H/2)
    return cnt

print(solve(H, W))

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
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 = (int(x) for x in input().split())
if H % 2 == 1 and W % 2 == 1:
    a = int(H/2)
    b = a + 1
    k = b + (int(W/2))*H
else:
    k = H * W / 2

print(k)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
HW=input().rstrip('\n').split()
H=int(HW[0])
W=int(HW[1])
if H%2==1 and W%2==1 :
    print (int(H*W+1/2))
else :
    print(int(H * W / 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
if W%2==1:
    x=W//2+1
    if H%2==1:
        print("{:.0f}".format(x*(H//2+1)+(x-1)*(H//2)))
    else:
        print("{:.0f}".format((2*x-1)*H/2))
else:
    x=W//2
    print("{:.0f}".format(x*H))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(solve())

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

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:
    tmp=W//2
    ans=H*tmp
elif Hm2==1 and Wm2==1:
    r=(W+1)//2
    tmp=(H-1)//2
    ans=W*tmp+r
else:
    if Hm2==0:
        even=H
        odd=W
    else:
        even=W
        odd=H
    tmp=even//2
    ans=odd*tmp
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil
HW = input()
H, W = int(HW.split()[0]), int(HW.split()[1])
# print(ceil(2.0*float(H*W)/4.0))
print(ceil(2*H*W/4))

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())
if h%2 == 0:
    print(h//2 * w)
else:
    tmp1 = math.floor(h/2)
    tmp2 = math.ceil(h/2)
    buf = math.floor(w/2)
    print(tmp2 * (w-buf) + tmp1 * (buf))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
if 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==0:
    B=int((H*W)/2)
    print (B)
else:
    C=int((H*W+1)/2)
    print (C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b= map(float,input().split())
ad=(a-1)//2
print('{0:.0f}'.format((a//2)*b if a%2==0 else ad*b+(b+1)//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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//2))
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(float,input().split())
print(int((h*w+1)/2))

Submission status: Wrong Answer

Solution code:
#n=int(input())
h,w=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
v1=h//2
v2=w//2
if h==1 or w==1:
    ans=0
elif h%2==0:
    ans=v1*w
else:
    if w%2==0:
        ans=v1*v2+(v1-1)*v2
    else:
        t=v1+1
        ans=v2*(t-1)+(v2+1)*t
print(ans)

Submission status: Wrong Answer

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

if H % 2 == 0 and W % 2 == 0:
    print("{}".format(int(H * (W // 2))))
elif H % 2 != 0 and W % 2 != 0:  # どっちもきすう
    print (H * (W // 2) + (H // 2)+1)
elif H % 2 != 0:
    print("{}".format(int(H * (W // 2))))
elif W % 2 != 0:  # Wがきすう
    print("{}".format(int(H * (W // 2) + (H // 2))))

Submission status: Wrong Answer

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

if (h*w) % 2:
    print(-(-(h*w)//2))
else:
    print(h*w//2)

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:
hw = input('')
h = int(hw.split(' ')[0])
w = int(hw.split(' ')[1])

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//2+1) + (w//2 * h//2)
  else:
    # 縦奇数ｘ横奇数
    result = (w//2 + 1) * (h//2+1) + (w//2 * h//2)
print(result)

Submission status: Wrong Answer

Solution code:


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

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

print(R)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0

for i in range(H):
    if i %2 == 0:
        ans += math.ceil(W/2)
    else:
        ans += math.floor(W/2)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

HW = input().split()

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


result = int(0)

y1 = 0
y2 = 0
if W%2 == 1:
    y1 = int(W/2) + 1
    y2 = int(W/2)
else:
    y1 = int(W/2)
    y2 = y1


if H%2 == 1:
    result += y1 * (int(H/2) + 1)
    result += y2 * int(H/2)
else:
    result += y1 * int(H/2)
    result += y2 * int(H/2)

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

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *

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

    print(dd.__ceil__())





if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math

for line in sys.stdin:
	a,b=map(int,line.split())
	if(a==1 and b==1):
		print(1)
	elif(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:
r,c = map(int,input().split())

if (r%2==1 and c%2==1):
    print(r*c//2+1)
else:
    print(r*c//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
sum=b*(a//2)
if a%2:
    sum+=b//2+1
if a==1 or b==1:
    print(1)
else:
    print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import math

H, W = map(int, input().split(' '))
ans = 0
for h in range(H):
    if h % 2 == 0:
        ans += int(math.ceil(W/2))
    else:
        ans += W//2
print(ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
elif 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:
import math
k = input()
c = k.split(' ')
d = int(c[1]) % 2
e = math.floor(int(c[1]) / 2)
print(int(c[0]) * e + d * math.ceil(int(c[0])/2))

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
ans = 0
if 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:
import math
h, w = map(int, input().split())

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

Submission status: Wrong Answer

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

lw = (w+1) // 2
rw = w // 2 

print(l * lw + r * rw)

Submission status: Wrong Answer

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

a = H * W

b = 0

for i in range(a):
    print(i)
    if(i % 2 == 0):
        b = b + 1


print(b)

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

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:
H, W = map(int, input().split(" "))
S = H * W
print(S // 2 + S % 2)

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if W%2 == 0:
  yoko_1 = int(W/2)
  yoko_2 = int(W/2)
else:
  yoko_1 = int(math.floor(W/2+0.5))
  yoko_2 = int(math.floor(W/2-0.5))
  
tate_1 = 0
tate_2 = 0

if H%2 == 0:
  tate_1 = int(H/2)
  tate_2 = int(H/2)
else:
  tate_1 = int(math.floor(H/2+0.5))
  tate_2 = int(math.floor(H/2-0.5))

result = yoko_1 * tate_1 + yoko_2 * tate_2

print(int(result))

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
h, w = map(int, input().split())
if h==0 or w==0:
  print(0)
  sys.exit()
if 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:
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 = rows // 2
EvenRowCount = rows // 2
if (OddRowCount % 2) != 0:
  OddRowCount = OddRowCount + 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:
W, H = tuple(map(int, input().split(" ")))
K = W * H
if W % 2 == 1 and H % 2 == 1:
    print(K // 2 + 1)
else:
    K //= 2
    print(K)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8


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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
import heapq


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


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


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy
# W, H = tuple(map(int, input().split(" ")))
W = 100000000
H = 999999999
K = W * H
if W % 2 == 1 and H % 2 == 1:
    print(K // 2 + 1)
else:
    K //= 2
    print(K)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

H, W = [int(n) for n in input().split()]
if H%2==0:
    print(math.floor(H/2)*W)
else:
    print(math.floor(H/2)*W+math.ceil(W/2))

Submission status: Wrong Answer

Solution code:
HW=input().rstrip('\n').split()
H=int(HW[0])
W=int(HW[1])
if H%2==1 and W%2==1 :
    print (int(H*W/2+1))
else :
    print(int(H * W / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(R)

Submission status: Wrong Answer

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

if h % 2 == 0:
  print("{0:.0f}".format(h*w/2))
else:
  a1 = h*(w//2)//2
  a2 = int(a1*2) +1
  print("{0:.0f}".format(a2))

Submission status: Wrong Answer

Solution code:
import math

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

reachables = math.ceil(width/2.0) * math.ceil(height/2.0) + math.floor(width/2.0) * math.floor(height/2.0)
print(reachables)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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