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:
from decimal import *
H,W=map(int,input().split())
t = H//2 + H%2
t2 = t + H//2
x = Decimal((W//2*t2)) + Decimal((W%2*t))
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
ctx = getcontext()
ctx.prec = 100
H, W = map(Decimal, input().split(' '))
sho, amari = ctx.divmod(ctx.multiply(H, W), 2)
print(ctx.add(sho,amari))

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import sys
getcontext().prec = 50
#ra = Decimal(a).sqrt()

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

if w % 2 == 0:
	cx0 = Decimal(w)//2
	cx1 = Decimal(cx0)
else:
	cx0 = Decimal(w) // 2 + 1
	cx1 = Decimal(cx0 - 1)

if h % 2 == 0:
	print(Decimal(Decimal(h // 2) * Decimal(cx0 + cx1)))
else:
	print(Decimal(h // 2) * Decimal(cx0 + cx1) + Decimal(cx0))

Submission status: Wrong Answer

Solution code:
def countSquares(row, column): 
    topLeft = min(row, column) - 1
    bottomRight = 8 - max(row, column) 
    topRight = min(row, 9-column) -1
    bottomLeft = 8 - max(row, 9-column)  
    return (topLeft + topRight + bottomRight + bottomLeft) 
res = 0
H,W = map(int,input().split())
Q = min(H,W)
for i in range(Q):
	  res += countSquares(i, i)
print(res//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    import numpy as np

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    h,w = map(int, input().split())
    
    print(min(ceil(h/2) * ceil(w/2) + floor(w/2)*floor(h/2), h*w//2+1))
        

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8


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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(masu)

Submission status: Wrong Answer

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

H, W = [int(x) for x in input().split()]
ans = 0

if H == 1 and W == 1:
    print(1)
    sys.exit()

if H == 1:
    print(W // 2 + int(W % 2 == 1))
    sys.exit()

if W == 1:
    print(H // 2 + int(H % 2 == 1))
    sys.exit()

# type2
b = H // 2

# type1
a = H - b

ans += b * (W // 2)
ans += a * (W - (W // 2))

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

  print(int(ans))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
h,w=input().split()
h=int(h)
w=int(w)
ans=0
if (h%2==0):
    for i in range(w):
        ans+=h//2;
else:
    for i in range(w):
        if (i%2):
            ans+=h//2
        else:
            ans+=h//2+1
print(ans)

Submission status: Wrong Answer

Solution code:
print(1)

Submission status: Wrong Answer

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

# print((w / 2) * (hei + wid))
# print(w % 2)
res = int(w / 2) * (hei + wid) if w % 2 == 0 else (int(w / 2) * (hei + wid)) + hei
print(res)

Submission status: Wrong Answer

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

print(r)

Submission status: Wrong Answer

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

H = i[0]
W = i[1]


if(W == 1):
    print(1)
elif(H == 1):
    if(W % 2 == 0):
        yoko = W // 2
    else:
        yoko = W // 2 + 1
    print(yoko)
#横が偶数の時は、縦の偶奇によらない
elif(W % 2 == 0):
    yoko = W // 2
    print(yoko*H)
#横が奇数の時は、縦の偶奇による
elif(W % 2 != 0):
    yoko = W // 2 + 1
    #縦が偶数の時
    if(H % 2 == 0):
        print(yoko*(H//2)+(yoko-1)*(H//2))
    #縦が奇数の時
    else:
        print(yoko*(H//2+1)+(yoko-1)*(H//2))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ans=(n*(m//2)+((n//2)+(n%2))*(m%2))
num=n
n=m
m=num
print(max(n*(m//2)+((n//2)+(n%2))*(m%2),ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil
h,w = map(int,input().split())
ans = h * (w // 2)
if w % 2 != 0 :
    ans += ceil(h/2)
if h==1 and w==1:
    ans = 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    h1 = (h + 1) // 2
    h2 = h // 2

    if (w % 2) == 1:
        print(h1 * ((w // 2) + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * (w // 2))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ans=(n*(m//2)+((n//2)+(n%2))*(m%2))
num=n
n=m
m=num
print(min(n*(m//2)+((n//2)+(n%2))*(m%2),ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

H, W = read_int()

def solve():
    ans = W * H // 2 + W * H % 2
    return ans

if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
HW = list(map(int,input().split()))
H = HW[0]
W = HW[1]
if type(H) is int and type(W) is int:
  if 1 <= H and W <= 10**9 and 1 <= W:
    out = H * W
    if out % 2 == 0:
       out = out/2
    elif out == 1:
       out = 1
    elif out == 0:
       out = 0
    else:
       out = ((out-1)/2)+1
    print(int(out))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

H, W = [int(x) for x in input().split()]
ans = 0

if H == 1 and W == 1:
    print(1)
    sys.exit()

# type2
b = H // 2

# type1
a = H - b

ans += b * (W // 2)
ans += a * (W - (W // 2))

print(ans)

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 H<W:
#    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=H*W/2
    mod=0
else:
    tmp = np.floor(W/2)
    mod = int(H % 2)
    res = int(H*tmp)+np.floor(H/2)
   
    #print(res,mod,int(res)+int(mod))
    
    


print(int(res)+mod)



#999999999 999999999

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
a=int(h/2)+1
b=h/2
c=0


for j in range(w):
        if j%2==1:
            c=c+a
        else:
            c=c+b
    





print(c)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import sys
getcontext().prec = 50
#ra = Decimal(a).sqrt()

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

if w % 2 == 0:
	cx0 = Decimal(w)//2
	cx1 = Decimal(cx0)
else:
	cx0 = Decimal(w) // 2 + 1
	cx1 = Decimal(cx0 - 1)

if h % 2 == 0:
	ans = Decimal(Decimal(h // 2) * Decimal(cx0 + cx1))
else:
	ans = Decimal(h // 2) * Decimal(cx0 + cx1) + Decimal(cx0)

print(int(ans))

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if h%2 == 0 and w%2 ==0:
    # ok
    ans = int(w/2) * h
elif h%2 != 0 and w%2 !=0:
    # NG
    tmp = int(w/2) + 1
    tmp2 = tmp-1
    ans = tmp * (int(h/2)+1) + tmp2 * int(h/2)

elif h%2 != 0 and w%2 == 0:
    
    ans = int(w/2) * h
elif h%2 == 0 and w%2 != 0:
    # ok
    tmp = int(w/2) + 1
    tmp2 = int(w/2)
    ans = tmp * int(h/2) + tmp2 * int(h/2)

print(ans)

Submission status: Wrong Answer

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

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

  print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

if (w < 2 and h < 2):
    print(0)
    exit()

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

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m =h*w

print(-(-m//2))

Submission status: Wrong Answer

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

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

if h == 1 or w == 1:
    ans = 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
h,w = map(int,input().split())
print(h*w//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = list(map(float, 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,m=map(int,input().split())
print(n*(m//2)+((n//2)+(n%2))*(m%2))

Submission status: Wrong Answer

Solution code:
#python3
from math import ceil
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:
        a = ceil(h/2)
        b = ceil(w/2)
        ans = a*b + (a-1)*(b-1)
    print(ans)
main()

Submission status: Wrong Answer

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

H, W = [int(x) for x in input().split()]
ans = 0

# type2
b = H // 2

# type1
a = H - b

ans += b * (W // 2)
ans += a * (W - (W // 2))

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
ctx = getcontext()
ctx.prec = 50
import math
H, W = map(Decimal, map(int, input().split(' ')))
sho, amari = ctx.divmod(ctx.multiply(H, W), 2)
print(ctx.add(sho,amari))

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

Submission status: Wrong Answer

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

print(number)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(h):
    for j in range(w):
        if j%2==1:
            c=c+a
        else:
            c=c+b





print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
h,w = map(int,input().split())
# 奇数番目は(h+1)//2 個取れる　偶数番目はn//2
ans = ((h+1)//2) * ((w+1)//2) + (h-(h+1)//2) * (w-(w+1)//2)
ans2 = h*(w//2)
if w %2 :
    ans2 += (h+1)//2
"""for h in range(100,10000000):
    for w in range(1,10000):
        ans = ((h+1)//2) * ((w+1)//2) + (h-(h+1)//2) * (w-(w+1)//2)
        ans2 = h*(w//2)+((h+1)//2 ) * (w%2)

        if ans != ans2:
            print(i,j, "not matched")"""
print(ans2)

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import sys
getcontext().prec = 50
#ra = Decimal(a).sqrt()

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

if w % 2 == 0:
	cx0 = int(w // 2)
	cx1 = int(cx0)
else:
	cx0 = int(w // 2 + 1)
	cx1 = int(cx0 - 1)

if h % 2 == 0:
	ans = Decimal(Decimal(h // 2) * Decimal(cx0 + cx1))
else:
	ans = Decimal(h // 2) * Decimal(cx0 + cx1) + Decimal(cx0)

print(Decimal(ans))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

H, W = read_int()

def solve():
    ans = (W // 2 + W % 2) * (H // 2 + H % 2) + (W // 2) * (H // 2)
    return ans

if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
import math


n= list(map(int, input().split()))

if n[0] % 2 == 0:
  print(math.ceil(n[0] / 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
else:
  result = math.ceil(n[0] / 2) * n[1] - math.floor(n[1] / 2)
  print(result)

Submission status: Wrong Answer

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

if not (w >= 2 and h >= 2):
    print(0)
    exit()

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

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = list(map(np.uint64, input().split()))
if N[0]%2==1 and N[1]%2==1:
  result = N[1] * (N[0]//2) + N[1] // 2 + 1
elif N[0]%2==0:
  result = N[1] * (N[0]//2)
elif N[1]%2==0:
  result = N[0] * (N[1]//2) 
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W=list(map(lambda i:int(i),input().split()))
masume=H*W
q,r=divmod(masume,2)
if r ==0:
    print(int(q))
else:
    q2,r2=divmod((masume+1),2)
    print(q2)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
h, w = map(int, input().split())

result = 0

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

Submission status: Wrong Answer

Solution code:
from decimal import *
ctx = getcontext()
ctx.prec = 50
import math
H, W = map(Decimal, map(int, input().split(' ')))
sho, amari = ctx.divmod(H*W, 2)
print(sho+amari)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
from decimal import *
import sys
getcontext().prec = 50
#ra = Decimal(a).sqrt()

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

if w % 2 == 0:
	cx0 = int(w // 2)
	cx1 = int(cx0)
else:
	cx0 = int(w // 2 + 1)
	cx1 = int(cx0 - 1)

if h % 2 == 0:
	ans = Decimal(Decimal(h // 2) * Decimal(cx0 + cx1))
else:
	ans = Decimal(h // 2) * Decimal(cx0 + cx1) + Decimal(cx0)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import *
getcontext().prec = 20

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

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

print(int(a))

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(x%2==1 and y%2==1):
  print(int(input_num/2)+1)
else:
  print(int(input_num/2))

Submission status: Wrong Answer

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

if m%2==1:
  d = (m+1)/2
  if n%2==0:
    ans = (d+d-1)*n/2
  else:
    ans = (d+d-1)*(n-1)/2 + d
else: # even
  ans = n * m/2
print(int(ans))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
        # 内包表記はpypyでは若干遅いことに注意
        # #numpy使うだろうからこれを残しておくけど
    return ret


# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from fractions import gcd


def lcm(a, b):
    # 最小公約数
    g = gcd(a, b)
    return a * b // g


H, W = read_ints()

# 市松模様を分解してカンガル
# Hはそのまま詰める
# print((H * (W // 2)) + (W % 2) * ((H + 1) // 2))
# print((H * (W // 2)), (W % 2) * ((H + 1) // 2))

# print()

# #.#.#
# .#.#.
# #.#.#
# .#.#.
# #.#.#

# # 一回すなおに実装してみる
# ans = 0
# ans += H * (W // 2)
# # Wが奇数の場合
# if W % 2 == 1:
#     ans += (H + 1) // 2
# print(ans)

if H * W == 1:
    print(0)
ans = 0
ans += W * (H // 2)
# Hが奇数の場合
if H % 2 == 1:
    ans += (W + 1) // 2
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

print(math.ceil(a*b/2))

Submission status: Wrong Answer

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

print(number)

Submission status: Wrong Answer

Solution code:
import math


n= list(map(int, input().split()))

if n[0] % 2 == 0:
  print(math.ceil(n[0]/ 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
else:
  result = math.ceil(n[0]/ 2) * n[1] - math.floor(n[1] / 2)
  print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7


a = ((h+1)>>1) * ((w+1)>>1)
b = (h>>1) * (w>>1)

print(a+b)

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 = 0
W = 0
SUM = 0

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

for i in range(H):
	if i % 2 == 0:
		SUM = SUM + (W + 1) / 2
	else:
		SUM = SUM + W / 2
print(SUM)

Submission status: Wrong Answer

Solution code:
arr = input().split()
h=int(arr[0])
w=int(arr[1])
 
if w*h%2!=0:
    ans=(w*h+1)//2
else:
    ans=w*h//2
print(ans)

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:
import numpy as np
N = list(map(np.int64, input().split()))
if N[0]%2==1 and N[1]%2==1:
  result = N[1] * (N[0]//2)
  result += N[1] // 2
  result += 1
elif N[0]%2==0:
  result = N[1] * (N[0]//2)
elif N[1]%2==0:
  result = N[0] * (N[1]//2) 
print(result)

Submission status: Wrong Answer

Solution code:
print(0)

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

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(x%2==1 and y%2==1):
  print(input_num/2+1)
else:
  print(input_num/2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H, W = [int(x) for x in input().split()]
ans = 0

h = H // 2

if W >= H:
    ans += (1 / 2) * h * (2 * H + (h - 1) * (-2))

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

w = W // 2

if H >= W:
    ans += (1 / 2) * w * (2 * W + (w - 1) * (-2))

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

ans -= min(H, W)

print(int(ans))

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 H<W:
#    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=int(H/2)*W
    mod=0
else:
    tmp = np.floor(W/2)
    mod = int(H % 2)
    res = int(H*tmp)+np.floor(H/2)
   
    #print(res,mod,int(res)+int(mod))
    
    


print(int(res)+mod)



#999999999 999999999

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if h == 1:
    print(1)

else:
    row1 = w//2 + w%2
    row2 = w//2

    total = (row1 * (h//2+h%2)) + (row2 * (h//2))

    print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if S % 2 == 0:
    print(s)
elif S % 2 == 1:
    print(s)

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_UP

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

Submission status: Wrong Answer

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

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