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:
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

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


    

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
INF = 10 ** 9
MOD = 10 ** 9 + 7

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

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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
ww=-(-W//2)
w_=W-ww
hh=-(-H//2)
h_=H-hh

print(ww*hh+w_*h_)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if n * m % 2 == 0:
    print(int((n * m) / 2))
else:
    print(int(((n * m) / 2)+1))

Submission status: Wrong Answer

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

    print(ans)



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(100000)


def read_values():
    return map(int, input().split())


def read_index():
    return map(lambda x: x - 1, map(int, input().split()))


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


def functional(N, mod):
    F = [1] * (N + 1)
    for i in range(N):
        F[i + 1] = (i + 1) * F[i] % mod
    return F


def main():
    H, W = read_values()
    if H == 1 or W == 1:
        print(1)
    print((H * W + 1) // 2)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

h_1=-(-H//2)
h_2=H//2

answer=W//2*(h_1+h_2)

if W%2==1:
    answer+=h_1

print(answer)

Submission status: Wrong Answer

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

if area == 1:
    print(0)
elif area % 2 == 0:
    print(area // 2)
else:
    print(-(-area // 2))

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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

resolve()

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
lh = H - H//2
lw = W- W//2
w = W//2
h = H//2

print(lh * lw + w * h)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    hguu = H if H % 2 == 0 else H - 1
    wguu = W if W % 2 == 0 else W - 1
    res = hguu * wguu // 2

    if H % 2 == 1:
        res += wguu // 2
    if W % 2 == 1:
        res += hguu // 2
    if H % 2 == 1 and W % 2 == 1:
        res += 1

    print(res)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil,floor
h,w=[int(i) for i in input().split()]
print(ceil(h/2)*ceil(w/2)+floor(h/2)*floor(w/2))

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:
    a = max(h, w)
    if min(h, w) == 1:
        print(1)
        exit()
    print(3 * (a // 2) + 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+1)//2)

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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:
import numpy as np
import fractions

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
#sys.setrecursionlimit(150000)


def solve(H: int, W: int):
    if H%2==0:
        print(H//2*W)
    elif W%2==0:
        print(W//2*H)
    else:
        print((H//2)*W+((W+1)//2))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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:
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
ans = (H//2)*(W//2) + (H-(H//2))*(W-(W//2))
print(ans)

Submission status: Wrong Answer

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

def resolve():
    H, W = iim()
    ha, hb = divmod(H, 2)

    ans = ha * W
    if hb:
        ans += W // 2
        if W & 1:
            ans += 1
    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    H, W = list(map(int, sys.stdin.readline().split()))

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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


h = inputs[0]
w = inputs[1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
#input = sys.stdin.readline


#N=int(input())

#A=list(map(int,input().split()))
#XY=[list(map(int,input().split())) for i in range(N)]

H,Y=map(int,input().split())
print(H*Y//2+H*Y%2)

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())
from math import ceil
h_odd_num = ceil(h / 2)
h_even_num = h // 2

w_odd_num = ceil(w / 2)
w_even_num = w // 2

print(h_odd_num * w_odd_num + h_even_num * w_even_num)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    print(W // 2 * H + (H // 2 + H % 2) * (W % 2))


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    #import sys
    #input = sys.stdin.readline
    H,W = map(int,input().split())
    if W%2==0:
        W2 = W/2
        W3 = W/2
    elif W%2==1:
        W2 = W//2+1
        W3 = W//2
    if H%2==0:
        H2 = H/2
        H3 = H/2
    elif H%2==1:
        H2 = H//2+1
        H3 = H//2
    mas = W2*H2 + W3*H3

    print(int(mas))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

if H>1 and W>1:
  print(math.floor((H*W+1)/2))
else:
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

q, mod = divmod(H * W, 2)

print(q if mod == 0 else q + mod)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = h * w

if h == 1:
    print(1)
    exit()

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

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
print(int(a*b*0.5+0.5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

Solution code:
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

h,w = inm()
p = h*w
print(p//2 + (1 if p%2==1 else 0))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

a, b = divmod(H*W, 2)
if b==0:
    print(a)
else:
    print(a+1)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H, W = map(int, input().split())
ans = 0
tmp1 = math.ceil(W / 2)
tmp2 = W // 2
ans += tmp1 * math.ceil(H / 2)
ans += tmp2 * (H // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
# from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction
mod = int(pow(10, 9)+7)


def ii(): return int(input())


def si(): return str(input())


def mi(): return map(int, input().split())


def li(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]


def isPowerOfTwo(x): return (x and (not (x & (x - 1))))


def decimalToBinary(n): return bin(n).replace("0b", "")


def ntl(n): return [int(i) for i in str(n)]


def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


def dfs(d, v):
    q = []
    q.insert(0, v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.insert(0, i)
        print(x)


n, m = mi()

if n == 1:
    print(1)
else:
    print(int(ceil(n*m/2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


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


main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
for i in range(1, H+1):
    if i % 2 != 0:
        ans += init
    else:
        ans += (init - 1)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import math
h_odds = math.ceil(h / 2)
h_evens = h // 2
w_odds = math.ceil(w / 2)
w_evens = w // 2
print(h_odds * w_odds + h_evens * w_evens)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def linput():
    return list(map(int, input().split()))

def main():
    # N = int(input())
    N,M = linput()
    # vA = linput()
    # S = input()
    # mX = [linput() for _ in [0,]*N]

    # res = 0
    if N%2 and M%2:
        res = -(-N*M//2)
    else:
        res = N*M//2

    print(res)

main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
H, W = [int(x) for x in input().strip().split()]
print((H // 2 + H % 2) * (W // 2 + W % 2) + (H // 2) * (W // 2))

Submission status: Wrong Answer

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

a = (W+1)//2+(W//2)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Panasonic2020 B

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

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

Submission status: Wrong Answer

Solution code:
import queue
import math
import copy
"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
(N,M) = (int(i) for i in input().split(" "))
S = N%2 + M%2
T = (N-N%2)*(M-M%2)//2
if N%2:
	T += (M+1)//2
if M%2:
	T += (N+1)//2
if S == 2:
	T -= 1
print(T)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    ans = math.ceil(W / 2) * math.ceil(H / 2)
    ans += math.ceil((W - 1) / 2) * math.ceil((H - 1) / 2)

    print(ans)



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil
h, w = map(int, input().split())
if min(h,w) <= 1:
    print(0)
    exit()

print(ceil(h * w / 2))

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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