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

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

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

print(int(ans))

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
d=x*y;
if d%2==0:
    print(int(d/2))
else:
    print(int((d/2)+1))

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

if h==1 and w==1:
  ans = 0
elif h==1 or w==1:
  ans = 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

even_rows = h // 2
odd_rows = (h+1) // 2

if w > 1 or h > 1:
    ans = 0
    ans += w // 2 * even_rows
    ans += (w+1) // 2 * odd_rows

    print(ans)
else:
    print(1)

Submission status: Wrong Answer

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

if H == 1 or W == 1:
  print(0) 
# 両方奇数の場合
elif H%2 == 1 and W%2 == 1:
  print((H*W)//2+1)
else:
  print((H*W)//2)

Submission status: Wrong Answer

Solution code:



hi, wd = map(int, input().split())


# いずれかが１の場合
if hi==1 or wd ==1:
    print(0)
    exit()

# heightまたはwidthが偶数だった場合
if hi%2 == 0 or wd%2 == 0:
    print(hi*wd//2)
else:
    print(hi*wd//2 + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(ans)

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(int(n + m))

Submission status: Wrong Answer

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

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

    ans += r

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

# ===FUNCTION===

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


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

    return outputData


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

    return outputDataList


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

    return outputDataList


# ===CODE===

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

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

ans = 0
ans += w * math.floor(h/2)

if h % 2 == 1:
    ans += math.floor(w/2) + math.floor(w % 2)

if w + h < 4:
    ans = 0

print(int(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

even = math.ceil(W/2)
odd = math.floor(W/2)

cnt = 0

if H%2:
    cnt = even*math.ceil(H/2) + odd*math.floor(H/2)
else:
    cnt = even*math.floor(H/2) + odd*math.ceil(H/2)
    
print(cnt)

Submission status: Wrong Answer

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

if h % 2 == 0:
    a = h // 2 * w
else:
    a = h // 2 * w + 2

print(a)

Submission status: Wrong Answer

Solution code:
string = input().split(' ')

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

ans = 0

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
# スペース区切りの整数の入力
h, w = map(int, input().split())

print(math.ceil(h*w/2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# Problem B - Bishop

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

g = int(s+t)

"""
for i in range(h):  
    if(i%2 == 0):
        count += s
    if(i%2 != 0):
        count += t
"""

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

print(int(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(math.ceil(h/2)*math.ceil(w/2)+math.floor(h/2)*math.floor(w/2))

Submission status: Wrong Answer

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

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


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

print(solve(H, W))

Submission status: Wrong Answer

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

if w % 2 == 0:
  count = (w / 2) * h
else:
  c1 = math.ceil(w / 2)
  c2 = math.floor(w / 2)
  if h % 2 == 0:
    count = (h / 2) * (c1 + c2)
  else:
    count = math.floor(h / 2) * (c1 + c2) + c1
print(int(count))

Submission status: Wrong Answer

Solution code:
import math

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

if w % 2 == 0:
    print(w // 2 * h)
else:
    a = math.ceil(w / 2)
    b = w - a
    if h % 2 == 0:
        print((a + b) * (h // 2))
    else:
        print((a + b) * (h // 2) + a)

Submission status: Wrong Answer

Solution code:
import math

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

count = math.ceil(h/2)
# for i in range(0,h,2):
#     count += 1
#print(count)
if h % 2 == 0:
    print(count * w)
else:
    #a = math.ceil(w/2)
    a = math.floor(w/2)
    #print(a)
    print((w - a) * count + (count - 1) * a)

Submission status: Wrong Answer

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

set_num = int(H/2)
#print(set_num)
number = int(set_num * W)
#print(number ,set_num)
amari = H - int(set_num) * 2
#print(number,amari)
number += amari * math.ceil(W/2)
print(int(number))

Submission status: Wrong Answer

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

HW = H * W
HW2 = HW // 2

if HW == 1:
    ans = 1
else:
    if HW % 2 == 0:
        ans = HW2
    else:
        ans = HW2 + 1

print(ans)

Submission status: Wrong Answer

Solution code:
h, w = (int(x) for x in input().split())
if w%2 == 0:
    odd_row = w // 2
    even_row = odd_row
else:
    odd_row = w // 2 + 1
    even_row = odd_row - 1
total = (h//2)*even_row + (h-h//2)*odd_row
print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    H, W = [int(_) for _ in input().split()]
    if H % 2 == 0 or W % 2 == 0:
        m = (H * W) /2
    else:
        m = (H * W) /2
        m = str(math.ceil(m))
    print(m)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# Author: cr4zjh0bp
# Created: Sat Mar 14 12:14:24 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

from math import ceil

H, W = na()
if (H * W) % 2 == 0:
    print(H * W // 2)
else:
    print(ceil(H / 2) * W - (W % 2) * (W // 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
H,W=(int(x) for x in input().split())
num=(H*W)/2
print(math.ceil(num))

Submission status: Wrong Answer

Solution code:
h,w = [int(x) for x in input().split()]
k = h*w
if k%2==0:
    print(int(k/2))
else:
    y = int(k/2)
    print(y+1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

fn = lambda x: (x + 1) // 2
gn = lambda x: x // 2

print fn(w) * fn(h) + gn(w) * gn(h)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = [int(e) for e in input().split()]
print((H*W+1) >> 1)

Submission status: Wrong Answer

Solution code:
h,w=[int(x) for x in 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())

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

Submission status: Wrong Answer

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

if S % 2 == 0:
    print(S//2)
else:
    print(S//2+1)

Submission status: Wrong Answer

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

if h == 1 or w == 1:
  print(1)
elif h % 2 == 0 or w % 2 ==0:
  print((h * w) // 2)
else:
  print(math.ceil((h * w) // 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    H, W = [int(_) for _ in input().split()]
    if H % 2 == 0 or W % 2 == 0:
        m = (H * W) /2
    else:
        m = (H * W) /2
        m = int(math.ceil(m))
    print(m)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(counter)

Submission status: Wrong Answer

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

even_rows = h // 2
odd_rows = (h+1) // 2

if w > 1:
    ans = 0
    ans += w // 2 * even_rows
    ans += (w+1) // 2 * odd_rows

    print(ans)
else:
    print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABCpana_B.py
from math import ceil
h,w=map(int,input().split())
# print(ceil(4/2))
if h==1:
    print(1)
    exit()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

hc = (w+1) // 2
hc2 = w // 2
d, m = divmod(h, 2)
ans = d * (hc + hc2) + m * hc

print(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:
  width = W / 2
  c = h_1 * width
  c += h_2 * width
else:
  width = math.ceil(W / 2)
  c = h_1 * width
  c += h_2 * (width - 1)

print(int(c))

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

Submission status: Wrong Answer

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

if n % 2 == 0 or w % 2 == 0:
    ans = (n * w) // 2

print(ans)

Submission status: Wrong Answer

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

if W%2==0:
    A_W=int(W/2)
    B_W=int(W/2)
    
    if H%2==0:
        A_H=int(H/2)
        B_H=int(H/2)
    else:
        A_H=int(H/2)+1
        B_H=int(H/2)
        
    ans=A_W*A_H+B_W*B_H
    
else:
    A_W=int(W/2)+1
    B_W=int(W/2)
    
    if H%2==0:
        A_H=int(H/2)
        B_H=int(H/2)
    else:
        A_H=int(H/2)+1
        B_H=int(H/2)
        
    ans=A_W*A_H+B_W*B_H
    
print(int(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
data=input().split(" ")
for i in range(2):
    data[i]=int(data[i])
ans=0
if(data[0]*data[1]%2==0):
    ans=data[0]*data[1]//2
else:
    ans=1+data[0]*data[1]//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

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

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

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
w_odd = math.ceil(H/2)
w_even = H // 2
N_odd = math.ceil(W/2)
N_even = W // 2
print(w_odd * N_odd + w_even * N_even)

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

Submission status: Wrong Answer

Solution code:

v, h = map(int
,input().split())
ans = (v*h + 1)//2

print(ans)

Submission status: Wrong Answer

Solution code:
#B
import math
h,w=map(int,input().split())
if h==w==1:
    print(0)
elif h==1 or w==1:
    print(1)
elif h%2==0 and w%2==0:
    print(int(h*w/2))
elif h%2==0 and w%2!=0:
    print(int(h*(w-1)/2+math.floor(h/2)))
elif h%2!=0 and w%2==0:
    print(int(w*(h-1)/2+math.floor(w/2)))
else:
    print(int((w-1)*(h-1)/2+math.floor(h/2)+math.floor(w/2)+1))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math as m
input = stdin.readline

r,c = map(int,input().split())

total = m.ceil(c/2) * m.ceil(r/2) + m.floor(c/2)* m.floor(r/2)

print(total)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h % 2 == 0 :
        h /= 2
        print(int(h))
else :
    h -= 1
    h /= 2
    print(int(h))

Submission status: Wrong Answer

Solution code:
import numpy as np
import fractions

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

# ===FUNCTION===

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


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

    return outputData


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

    return outputDataList


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

    return outputDataList


# ===CODE===

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

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

ans = 0
ans += w * math.floor(h/2)

if h % 2 == 1:
    ans += math.floor(w/2) + math.floor(w % 2)

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math


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

ans = (H // 2) * W

if H % 2 == 1:
    ans += math.ceil(W / 2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
def main(w,h):
    if w%2 == 0:
        return (w/2)*h
    else:
        if h%2 == 0:
            return (((w+1)/2)+(w-1)/2) * h/2
        else:
            return ((w+1)/2 * (h+1)/2) + ((w-1)/2 * (h-1)/2)

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

Submission status: Wrong Answer

Solution code:
h,w=map(int,input().split())
e=w//2
o=w-e
E=h//2
O=h-E
c=e*E+o*O
print(c)

Submission status: Wrong Answer

Solution code:
from math import *

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

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

print(int(ans))