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


main()

Submission status: Wrong Answer

Solution code:
import sys
# sys.stdin = open('input.txt')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = input()
data = i.split(" ")
if int(data[0])==1 or int(data[1]==1):
    print(1)
elif (int(data[0])*int(data[1]))%2 == 0:
    print(int(data[0])*int(data[1])//2)
else:
    print(int(data[0])*int(data[1])//2+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = (int(x) for x in input().split())
if h%2 == 1 and w%2 == 1:
    a = (h*w)//2 +1
else :
    a = h*w/2
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
h,w = map(int,input().split())
count = 0
for i in range(h):  
    if(i%2 == 0):
        count += math.ceil(w/2)
    if(i%2 != 0):
        count += math.floor(w/2)
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


a = int(W / 2 + 0.5)

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

Submission status: Wrong Answer

Solution code:
from collections import deque, defaultdict, Counter
from math import ceil, floor
import sys
def input():
    return sys.stdin.readline().strip()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = inp[0]*inp[1]

if (a %2 == 1):
    b = int(a/2)+1
else:
    b = a/2

print('{:.19g}'.format(b))

Submission status: Wrong Answer

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

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

print(int(ans))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

print(-(-(h * w) >> 1))

Submission status: Wrong Answer

Solution code:
HW = [int(i) for i in input().split()]
h = HW[0]
w = HW[1]
if h % 2 == 0:
    ans = h*w/2
else:
    if w % 2 == 0:
        ans = h * w / 2
    else:
         ans = (w * (h - 1) / 2) + ((w + 1) / 2)
ansint = int(ans)
print (ansint)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 共に奇
if h % 2 == 1 and w % 2 ==1:
    print(int((h // 2 + 1) * (w // 2 + 1) + (h // 2) * (w // 2)))
    exit(0)
# 片方偶数
if h % 2 == 0 and w % 2 ==1:
    print(int((h // 2) * (w // 2 + 1) + (h // 2) * (w // 2)))
    exit(0)
if h % 2 == 1 and w % 2 ==0:
    print(int((h // 2 + 1) * (w // 2) + (h // 2) * (w // 2)))
    exit(0)
else:
    print(int(h * w / 2))
    exit(0)

Submission status: Wrong Answer

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

counts = 0
for i in range(1, rows + 1):
  mod = i % 2
  if mod == 0:
    counts = counts + Even
  else:
    counts = counts + Odd

print(counts)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a=input().split(' ')

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

Submission status: Wrong Answer

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

if W % 2 ==0 or H % 2 ==0:
    print(int(0.5*W*H))

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

Submission status: Wrong Answer

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

# process
ans = 0
if W == 1:
    print((H+1)//2)

elif H == 1:
    print((W+1)//2)

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

Submission status: Wrong Answer

Solution code:
# Problem B - Bishop

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

if H%2==0: # even count
    if W==1:
        print(0)
    else:
        print(H//2 * W)
else:
    if W==1:
        print(0)
    else:
        even_count = (H//2+1) * (W//2 + 1)
        nokori  = W - W//2 - 1
        odd_count = H//2 * nokori
        print(even_count + odd_count)

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

print(ans // 2)

Submission status: Wrong Answer

Solution code:
H = input().split()
h = int(H[0])
w = int(H[1])
if h % 2 == 1:
    if w % 2 ==1:
        print((h/2 +0.5) * (w/2 +0.5) + (h/2 -0.5) * (w/2 -0.5))
    else:
        print((w/2 * h))
elif w % 2 ==1:
    print(h/2*w)
else:
    print(h/2 *w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    print(ans)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    print(-(-(H*W)//2))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    solve(H, W)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
import math
s = input().rstrip().split(' ')
height = int(s[0])
width = int(s[1])
area = height * width
print(int(math.ceil(area / 2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if width == 1:
  result = 1
  
elif width%2 == 0:
    num_1 = width/2
    
    result = num_1 * height
    
else:
    num_1 = int(width/2) + 1
    
    if height%2 == 0:
        result = (num_1 + (num_1 - 1)) * height/2
    else:
        result = (num_1 + (num_1 - 1)) * int(height/2) + num_1
 
print(int(result))

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:
import math

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

H = int(H)
W = int(W)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
height, width = map(int, input().split())
i, j = 0, 0
if height % 2 > 0:
    i = height // 2 + 1
else:
    i = height // 2

if width % 2 > 0:
    j = width // 2 + 1
else:
    j = width // 2

ans = 0
if height % 2 > 0 or width % 2 > 0:
    ans = i * j + (j - 1) * height // 2
else:
    ans = i * j + j * height // 2
print(ans)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()

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

exit()
if W % 2 == 0:
    a = W // 2
    b = W // 2
else:
    a = W // 2 + 1
    b = W // 2
# a = ceil(W / 2)
# b = ceil((W-1) / 2)
print(a)
print(b)
if H % 2 == 0:
    ans = a * H // 2 + b * H // 2
    print(H//2)
    print(H//2)
else:
    ans = a * (H // 2+1) + b * H // 2
    print(H//2+1)
    print(H//2)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
from collections import deque, defaultdict
import bisect
from math import factorial


def main():
    H, W = map(int, input().split())
    
    odd_row_cell = W // 2 if W % 2 == 0 else (W+1) // 2
    even_row_cell = W // 2 if W % 2 == 0 else (W-1) // 2

    odd_row_num = H // 2 if H % 2 == 0 else (H+1) // 2
    even_row_num = H // 2 if H % 2 == 0 else (H-1) // 2

    num = odd_row_cell * odd_row_num\
        + even_row_cell * even_row_num

    print(int(num))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if W == 0:
    print(0)
elif H * W == 1:
    print(0)
else:
    print(math.ceil(H * W / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if a*b%2 == 0:
	print(int(a*b/2))
else:
	print(int(math.floor(a*b/2)+1))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if (a or b) !=1:
  if a %2 == 0:
    #たて一列でぬれるのは
    c = int(a/2)
    print(c*b)
  else:
  #たて一列目は
    d = int((a+1)/2)
    e = int((a-1)/2)
    if b %2 == 0:
      print(int((d+e)/2*b))
    else:
      print(int((d+e)/2*(b-1)+d))
else:
  print(1)

Submission status: Wrong Answer

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

q = h * w // 2
r = h * w % 2

print(q + r)

Submission status: Wrong Answer

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

if h%2==0 and w%2==0:
    print(h*w//2)
if (h+w)%2!=0:
    print(h*w//2)
if h%2!=0 and w%2!=0:
    num=(min(h,w)+1)//2
    num1=(max(h,w)+1)//2
    ans=num*num1+(num1-1)*(min(h,w)-num)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
ans = 0
k = 0
l = 0

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

Submission status: Wrong Answer

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

H2 = H // 2
if H % 2 == 1:
    H2 += 1

W2 = W // 2
if W % 2 == 1:
    W2 += 1

H3 = H - H2
W3 = W - W2

print(H2 * W2 + H3 * W3)

Submission status: Wrong Answer

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

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

s = h * w

if s % 2:
    print(s//2+1)
else:
    print(s//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if 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:
import numpy as np
h_w_list = [int(i) for i in input().split()]

if h_w_list[0] == 1 or h_w_list[1] ==1:
    print(1)

elif h_w_list[0]*h_w_list[1] % 2 == 0:    
    print(h_w_list[0]*h_w_list[1]/2)

else:
    print(np.ceil(h_w_list[0]*h_w_list[1]/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter

# import numpy as np
# import scipy as scp

# 入力の受け取り
h,w = map(int,input().split())

if h==1 and w == 1:
    ans = 1
elif h%2 == 0:
    ans = (h*w)//2
else:
    w1 = w//2
    w2 = w-w1
    ans = ((h//2)*w1) + (((h+1)//2)*(w2))
    
print(ans)
# print("{:.10f}".format(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if (H or W)<=2:
    ans=1
if H==2 and W==2:
    ans=2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def main():
    n, m = map(int, input().split())
    ans = ((m + 1) // 2) * ((n + 1) // 2)
    ans += (m // 2) * (n // 2)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

up = (w + 1) // 2
down = w // 2

if h % 2 == 0:
    print((up + down) * (h // 2))
else:
    print((up + down) * (h // 2) + up)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


def main():

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

    temp_w1 = 0
    temp_w2 = 0
    if w % 2 == 0:
        temp_w1 = int(w / 2)
        temp_w2 = int(w / 2)
    else:
        temp_w2 = int(w / 2)
        temp_w1 = int(w / 2) + 1

    result = 0
    if h % 2 == 0:
        result += temp_w1 * (h / 2)
        result += temp_w2 * (h / 2)
    else:
        result += temp_w1 * (int(h / 2) + 1)
        result += temp_w2 * int(h / 2)

    print(int(result))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    h, w = LI()
    ans = 0
    x = w // 2
    y = (w + 1) // 2
    ans += h // 2 * x
    ans += (h + 1) // 2 * y
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:08:49 2020

@author: H_Hoshigi
"""

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

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

Submission status: Wrong Answer

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

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


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
# for i in range(h):
#     if i % 2 == 0:
#         ans += w // 2 + 1
#     else:
#         ans += w // 2
if w % 2 == 0:
    ans = h * w // 2
else:
    if h % 2 != 0:
        ans = h * w // 2 + 1
    else:
        ans = h * w // 2


print(ans)

Submission status: Wrong Answer

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

if H % 2 == 1:
    H_count = H // 2
    if W % 2 == 1:
        count = H_count*W + W//2 + 1
    else:
        count = H_count*W + W//2

else:
    H_count = H / 2
    count = H_count * W

print(int(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = [int(i) for i in input().split(' ')]

print(num[0] * num[1] / 2)

Submission status: Wrong Answer

Solution code:
def main():
  import sys
  input = sys.stdin.readline
  h,w=map(int,input().split())
  if h==1:
    print(w//2 if w%2==0 else w//2+1)
    exit()
  if w==1:
    print(h//2 if h%2==0 else h//2+1)
    exit()
  if h%2==0:
    print(w*h//2)
  else:
    print((h//2)*w+(w//2 if w%2==0 else w//2+1))
  
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:02:27 2020

@author: morihiranaoki
"""

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

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

print(int(movable))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

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

Submission status: Wrong Answer

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

if h & 1:
    if w & 1:
        c = ((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2)
    else:
        c = (((h + 1) // 2) + (h // 2)) * (w // 2)
else:
    c = (h // 2) * w

print(c)

Submission status: Wrong Answer

Solution code:
from math import ceil

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 += ceil((W // 2) * H / 2)
        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:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:11:42 2020

@author: Kanaru Sato
"""

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

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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import math

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

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

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+0.5))

Submission status: Wrong Answer

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

i = h * w

if(i % 2 == 0):
    ans = i//2

elif (i % 2 == 1):
    ans = i//2 + 1

print(ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

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

print("%d"%int(h*w//2-(-h//2)*w%2))

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:
import numpy as np
import sys
h,w = map(int,input().split())
if w%2 == 0:
    if h%2 == 0:
        print(((w//2)*(h//2))*2)
    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))