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:
import sys
import itertools
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H,W = IL()

numb = W//2
numa = W - numb

numd = H//2
numc = H - numd
ans = numa * numc + numb * numd

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *
INF = 500000
mod = 10**9+7

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


# a, b, c = input(), input(), input()
# la, lb, lc = len(a), len(b), len(c)
# for i in range(1, min(la, lb)):
#     S = ''
#     for j in range(i):
#         if a[la-i+j] == b[j]:
#             S += b[j]
#             continue
#         elif a[la-i+j] == '?':
#             S += b[j]
#         elif b[j] == '?':
#             S += c[j]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main2(w,h):
    if w%2==1 and h%2==1:
        return int(((w*h)+1)/2)
    else:
        return int(w*h/2)

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

Submission status: Wrong Answer

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

if w == 1 or h == 1:
    print(1)
    exit()
    
if w == 2 and h == 2:
    print(2)
    exit()

if w % 2 == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    second = can - 1
    num = can + second
elif w % 2 == 1 and h == 1:
    idle = int((w - 1) / 2)
    can = w - idle
    print(can)
    exit()
elif w % 2 == 0 and h == 1:
    print(1)
    exit()
else:
    can = 0
    idle = int(w / 2)
    num = idle * 2
    
if h % 2 == 1:
    row = int(h // 2)
    print(num * row + can)
else:
    row = int(h / 2)
    print(num * row)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

totalsum = W * (H//2)
if (H % 2) == 1:
	totalsum += W // 2
	totalsum += 1

print(totalsum)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math

h,w = [int(x) for x in stdin.readline().rstrip().split()]
if h == 1:
    ans = 1
else:
    ans = int(w/2)*h + (w%2)*math.ceil(h/2)
print(ans)

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
a=0
b=0
c=0
for i in range(h):
    if i%2==0:
        a=a+1
for j in range(w):
    if j%2==1:
        b=b+1
c=a+b
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
if __name__ == '__main__':
    (h, w) = tuple(map(int, input().split()))
    a = math.ceil((h * w) / 2)
    print(a)

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

num = X * Y
if num % 2 == 0:
  out = int(num / 2)
if num % 2 == 1:
  out = int((num -1)/2 + 1)
print(out)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]
print(-(-Line[0]*Line[1] // 2))

Submission status: Wrong Answer

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


cnt = 0
for h in range(1, H+1):
    if h % 2 == 1:
        if w % 2 == 1:
            cnt += w // 2 + 1
        if w % 2 == 0:
            cnt += w // 2
    if h % 2 == 0:
        if w % 2 == 1:
            cnt += w // 2
        if w % 2 == 0:
            cnt += w // 2 + 1

print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

w1 = w2 = 0
if w % 2 == 0:
    w1 = w / 2
    w2 = w / 2
else:
    w1 = (w + 1) / 2
    w2 = (w - 1) / 2

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
h, w = (int(x) for x in input().split())
if h == 1 or w == 1:
    odd_row = 0
    even_row = 0
elif 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 % 2 == 0 and w % 2 == 0:
    print( (h*w)//2)
elif h % 2 == 0  and w % 2 != 0:
    print( (h//2) * w)
elif h % 2 != 0 and w % 2 == 0:
    print(h * (w//2))
elif h % 2 != 0 and w % 2 != 0:
    h = h//2
    ans = (w*h) + (h-1)
    if ans < 0:
        ans = 0
    print(ans)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
n1 = int(n/2)
n2 = n-n1
m1 = int(m/2)
m2 = m-m1

ans = n2*m2+n1*m1
print("%ld"%ans)

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:
    print(1)
elif W == 1:
    print(1)
else:
    if H > W:
        print(int((H-1)*W-H))
    elif H == W:
        print(H*(H-1)-1)
    else:
        print(int((W-1)*H-W))

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-1)/2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3 ## -*- python -*-

t = input().split()
h = int(t[0])
w = int(t[1])

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

print(a)

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

print(math.floor(c))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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)

Submission status: Wrong Answer

Solution code:
import math

firstInputText = input()
inputList = firstInputText.split()
x = int(inputList[0])
y = int(inputList[1])
result = math.ceil(x*y/2)
if result <= 2:
        print(0)
else:
    print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
a, b = [int(x) for x in input().split()]
if a >=2 and b >= 2:
	if a == 2 and b == 2:
		print(1)
	else:print( ((a * b) + 1) // 2)
else:
	print(0)

Submission status: Wrong Answer

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

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

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:
    print(0)
elif W == 1:
    print(0)
else:
    if H > W:
        print(int((H-1)*W-H))
    elif H == W:
        print(H*(H-1)-1)
    else:
        print(int((W-1)*H-W))

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

Submission status: Wrong Answer

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

if R % 2 == 0:
    print(int(R / 2 * C))
else:
    if C % 2 == 0:
        print(int(((R // 2)) * C + (C / 2)))
    else:
        print(int((R // 2)* C + (C//2+1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(math.ceil(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!python3.4
# -*- coding: utf-8 -*-
# panasonic2020/panasonic2020_b
import sys, math

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    H, W = i2nn()
    n = int(H * W + 1 // 2)
    print(n)
    return

main()

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

Submission status: Wrong Answer

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

if hw[0] % 2 == 0 and hw[1] % 2 == 0:
    count = (hw[0] * hw[1]) // 2
elif hw[0] % 2 != 0 and hw[1] % 2 == 0:
    count = ((hw[0] + 1) * hw[1] // 2) - (hw[1] // 2)
elif hw[0] % 2 == 0 and hw[1] % 2 != 0:
    count = ((hw[1] + 1) * hw[0] // 2) - (hw[0] // 2)
else:
    count = ((hw[0] + 1) * (hw[1] + 1) // 2) - ((hw[0] // 2 + 1) + (hw[1] // 2 + 1) - 1)
print(count)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
n1 = int(n/2)
n2 = n-n1
m1 = int(m/2)
m2 = m-m1

ans = n2*m2+n1*m1
print("%d"%ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

else:
    ans = (H * W) - ((H * W) // 2)

print(str(int(ans)))

Submission status: Wrong Answer

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

if a % 2 == 0 or b % 2 == 0:
  print(a * b // 2)
  
if a % 2 == 1 and b % 2 == 1:
  ans = (a * b) //2 + (a + 1) //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
    

if W%2==0:
    res=(H/2)*W
else:
    tmp = (W//2)
    res = H*tmp+H//2+H%2
    #print(H//2)
    

print(int(res))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
h,w=(map(int,input().split()))
i=0
n=0
if h%2==0 and w%2==0:
  print(int(h/2*w))
elif h%2==1 and w%2==1:
    i=(h/2+0.5)+(h/2-0.5)
    n=math.floor(w/2)
    print(int(i*n+(h/2+0.5)))
elif h%2==0 and w%2==1:
  print(int(h/2*w))
elif h%2==1 and w%2==0:
  print(int(w/2*h))

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:
posx, posy = input().split(" ")

bord = int(posx) * int(posy)
if int(posx)==1 or int(posy)==1:
  print(int(posx)*int(posy)-1)
else:
  print(bord-int(bord/2))

Submission status: Wrong Answer

Solution code:
import math

# h = 縦, w = 横
h, w = (int(x) for x in input().split())
# 4,5 → 10

ans = 0

# 横が偶数のとき
if w % 2 == 0:
    # 縦偶数ますのとき
    if h % 2 == 0:
        # print('横偶数、縦偶数')
        ans_1 = (w / 2) * (h / 2)
        ans_2 = (w / 2) * (h / 2)
    # 縦奇数ますのとき
    else :
        # print('横偶数、縦奇数')
        a = (w / 2)
        b = (h + 1) / 2
        ans_1 = a * b
        c = (w - 1) / 2
        d = (h / 2)
        ans_2 = c * d
# 横が奇数のとき
else :
    # 縦偶数ますのとき
    if h % 2 == 0:
        # print('横奇数、縦偶数')
        ans_1 = (w + 1)/ 2 * (h / 2)
        # print(ans_1)
        ans_2 = (w - 1)/ 2 * (h / 2)
        # print(ans_2)
    # 縦奇数ますのとき
    else :
        # print('横奇数、縦奇数')
        a = (w + 1) / 2
        b = (h + 1) / 2
        ans_1 = a * b
        c = (w - 1) / 2
        d = (h - 1) / 2
        ans_2 = c * d

ans = ans_1 + ans_2

print(math.floor(ans))

Submission status: Wrong Answer

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


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


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2))

Submission status: Wrong Answer

Solution code:
H, W = [int(_) for _ in input().split()]
if H %2 == 0:
    print(int(H*W/2))
else:
    print(int((H-1)*W/2 + W/2 + 1))

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

Submission status: Wrong Answer

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

Z = H * W % 2

if H or W ==1:
    print(1)
elif H or W != 1:
    if Z == 1:
        print(int((H * W - 1) / 2 + 1))
    elif Z == 0:
        print(int((H * W) / 2))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_b
# -*- coding: utf-8 -*-
H, W = 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())
row_even= H%2 == 0
col_even = W%2== 0
res = 0
if H <= 1 and W<=1:
    res = 1
elif row_even and col_even:
    res = (H*W)//2
elif row_even and not col_even:
    res = W*H//2
elif not row_even and not col_even:
    res = W*(H//2)+W-1
else:
    res = (W//2)*H
print(res)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def result(h, w):

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


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

if (h < 0 or w < 0):
    print(0)
else:
    result(h, w)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# num = H * W


if H == 0 or W == 0:
    print(int(0))

elif H == 1 or W == 1:
    print(int(1))

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

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

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

else:
    if H == 3 or W == 3:
        ans = max(H, W)
        print(int(ans + (ans-ans//2)))
    else:
        num = H // 2
        ans = num * W
        print(int(ans + (H-(num))))

Submission status: Wrong Answer

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

totalsum = W * (H//2)
if (H % 2) == 1:
	totalsum += W // 2
	totalsum += 1

print(totalsum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = [int(x) for x in input().split(" ")]
if a[1] <= 0 :
    print(0)
    exit()
kisu = a[0] // 2 if a[0] % 2 == 0 else a[0] // 2 + 1
gusu = a[0] // 2
yokokisu = a[1] // 2 if a[1] % 2 == 0 else a[1] // 2 + 1
yokogusu = a[1] // 2
ans = kisu * yokokisu + gusu * yokogusu
print(ans)

Submission status: Wrong Answer

Solution code:
import math

H, W = [int(i) for i in input().split()]
ans = math.ceil(H * W / 2)
print(ans)

Submission status: Wrong Answer

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

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

print(SUM)

Submission status: Wrong Answer

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


def main():

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

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

    print(int(result))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
h,w = [int(x) for x in stdin.readline().rstrip().split()]
import math
def bishop(h,w):
    if h == 1:
        ans = 1
    else:
        ans = int(w/2)*h + (w%2)*math.ceil(h/2)
    print(ans)
    return

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(int(c))

Submission status: Wrong Answer

Solution code:
import math

firstInputText = input()
inputList = firstInputText.split()
x = int(inputList[0])
y = int(inputList[1])
result = math.ceil(x*y/2)
if result == 1:
        print(0)
else:
    print(result)

Submission status: Wrong Answer

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

if H==1 or W==1:
  print(1)
  exit()

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

Submission status: Wrong Answer

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

if H % 2 != 0 and W % 2 == 0:
    H, W = W, H

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

Submission status: Wrong Answer

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

print(solve())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H == 1 and W == 1:
  c = 1
elif H == 1:
  if W % 2 == 0:
    c = W / 2
  else:
    c = math.ceil(W / 2)
elif W == 1:
  c = math.ceil(H / 2)
else:
  if W % 2 == 0:
    c = H * W / 2
  else:
    c = H * W + H
  
print(int(c))

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 if h > 1 else 1
w_b = w // 2 if w > 1 else 1

if((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Submission status: Wrong Answer

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

mas = h*w

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

Submission status: Wrong Answer

Solution code:
mi = lambda : map(int,input().split())

h,w = mi()
ans = 0

if h%2 ==0:
    hr = h
    hm = 0
else:
    hr = h-1
    hm = 1

if w%2 ==0:
    wr = w
    wm = 0
else:
    wr = w-1
    wm = 1

ans = hr * wr //2
ans += hr * wm //2 + wr * hm //2 

if(wm & hm):
    ans +=1

if(h==1 | w==1):
    print(1)
else:
    print(ans)

Submission status: Wrong Answer

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

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

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