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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
s = input().rstrip().split(' ')
height = int(s[0])
width = int(s[1])
area = height * width
if type(area / 2) == int:
	print(area / 2)
else:
	print(math.ceil(area / 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:
def main():
    h, w = input().split()
    h, w = int(h), int(w)

    if w % 2 == 0:
        w_ans = w
        w1 = int(w / 2)
    else:
        w_ans = w
        w1 = 1 + int(w / 2) 

    if h % 2 == 0:
        ans = w_ans * int(h / 2)
    else:
        ans = w1 + w_ans * int(h / 2)

    print(int(ans))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import glob


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\159\\B'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        tmp = [int(i) for i in self.input_data().split()]
        H = tmp[0]
        W = tmp[1]

        count = 0
        '''        
        if H % 2 == 1:
            h_tmp = H -1
        else:
            h_tmp = H

        if W % 2 == 1:
            w_tmp = W -1
        else:
            w_tmp = W
        '''
        count = int(H * W / 2)

        if H % 2 == 1 and W % 2 == 1:
            count += 1

        print(str(count))


solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
lis = s.split()
h = int(lis[0])
w = int(lis[1])

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

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


H, W = MI()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
hei,wid=map(int,input().split())
s=0
s+=hei*wid
if s%2==0:
    print(s//2)
elif (hei==1 and wid>=1) or (hei>=1 and wid==1):
    print(1)
elif s%2!=0:
    print(s//2+1)

Submission status: Wrong Answer

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

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

print(ans // 2)

Submission status: Wrong Answer

Solution code:
num = input().split(' ')
H, W = int(num[0]), int(num[1])
HW = H * W
output = int(HW / 2)
if HW % 2 == 0:
	print(output)
else:
	print(output+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    H, W = map(int, input().split())

    h1 = (H + 1) // 2
    h2 = H // 2
    w1 = (W + 1) // 2
    w2 = W // 2

    ans = h1 * w1 + h2 * w2
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
import math
x,y=map(int,input().split())
a=math.ceil(x/2)
b=math.floor(x/2)
if(y%2==0):
    print((a+b)*y//2)
else:
    print(a*math.ceil(y/2)+b*math.floor(y/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

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

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

Submission status: Wrong Answer

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

r, c = h//2, w//2
ans = r * c
if h%2 == 1:
    r = h//2  + 1

if w%2 == 1:
    c = w//2 + 1

ans += r * c
print(ans)

Submission status: Wrong Answer

Solution code:
h,w = list(map(int, input().split()))
h1 = h//2
h2 = h//2 + h%2
w1 = w//2
w2 = w//2 + w%2

print(h1*w1 + h2*w2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
if H!=W:
    mas=-(-W//2)
    nextmas=mas-1
    Set=int(H/2)
    amari=H%2


    num=(mas+nextmas)*Set
    
    num+=mas*amari

    print(int(num))
else:
    mas=-(-W//2)
    num=mas*H
    print(num)

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

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    # print(int((H/2)*W) if H%2==0 else int((H//2)*W+math.ceil(W/2)))
    print(math.ceil(H*W/2))
    return


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
s = input().split()
t = [int(p) for p in s]

#print(t)
if(t[0] % 2 == 1 and t[1] % 2 == 1):
    n = (t[0] - 1) / 2
    m = (t[1] - 1) / 2
    answer = (m + 1) * (n + 1) + m * n
else:
    answer = t[0] * t[1] /2

print(int(answer))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = h * w

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

Submission status: Wrong Answer

Solution code:
import numpy as np
H, W = map(int, input().split())

odd = np.ceil(H/2)
even = np.floor(H/2)

res = odd*np.ceil(W/2) + even*np.floor(W/2)
print(int(res))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

hw = h*w

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
H,W=map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
h,w = map(int, input().split())
a = h//2;
b = h-a;

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    H,W = list(map(int, input().split(' ')))
    if(H%2 != 0):
        print(W*(math.floor(H/2)) + math.ceil(W/2))
    else:
        print(W*(H//2))
main()

Submission status: Wrong Answer

Solution code:
import math

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

cx0 = math.ceil(w / 2)
cx1 = w // 2

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

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)//2*b-(b//2))
    else:
        print(b//2*a)
else:
    print(a//2*b)

Submission status: Wrong Answer

Solution code:



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


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

# 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:
#!/usr/bin/env python3
import sys


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

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 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 * (h//2)

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import ceil
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(0)
    exit()
ans = 0
ans += ceil(W / 2) * ceil(H / 2)
ans += W // 2 * H // 2
print(ans)

Submission status: Wrong Answer

Solution code:

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

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import *
n,m = input().split(' ')
if(n==1 or m==1):
    print(0)
else:
    print(ceil((int(n)*int(m))/2))

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

Solution code:
import sys
H, W = map(int, sys.stdin.readline().rstrip().split())

if W == 1:
    print(1)
else:
    h_syou, h_amari = divmod(H, 2)
    w_syou, w_amari = divmod(W, 2)
    if w_amari == 0:
        print(w_syou * H)
    else:
        print((w_syou * H) + h_syou + h_amari)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int, input().split())
count = 0
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:
import math
h,w = 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(((h + 1) // 2) * ((w + 1) // 2) + (h // 2) * (w // 2))

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

print(res)

Submission status: Wrong Answer

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

a=w*(h//2)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

ans = 0

if H == 1 or W == 1:
    ans = 1

# 偶数が含まれる
if H % 2 == 0 or W % 2 == 0:
    ans = int((H * W) / 2)
else:
    ans = int((H * W) / 2) + 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import ceil
H, W = map(int, input().split())
if H == 1 or W == 1:
    print(0)
    exit()
ans = 0
ans += ceil(W / 2) * ceil(H / 2)
ans += W // 2 * H // 2
print(ans)
print(ceil((H * W) / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

ans = 0
q, mod = divmod(H, 2)
if mod == 0:
    ans = W * q
else:
    ans = W * q + math.ceil(W / 2)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    h, w = map(int, input().split())
    ans = (h * w) // 2
    if h % 2 == w % 2 == 1:
        ans = ans + 1
    print("%d" % ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	b , c = IN()
	e=((b+1)//2)
	o=b//2
	ret=0
	ret+=e*((c+1)//2)
	ret+=o*(c//2)
	print(ret)

	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def calc(w, h):
    result = w * h / 2

    if w * h % 2 != 0:
        result += 1

    return int(result)


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

result = calc(w, h)
print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B=map(int, input().split())
cnt=0
if A%2==0 or B%2==0:
  cnt=A*B//2
else:
  cnt=B*A//2+B//2
  
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

res = 0
res += W * (H // 2)

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

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    h,w=list(map(int, readline().strip().split()))

    if w==1:
        print(1)
        return

    ki=(w+1)//2
    gu=w//2

    amari=h%2
    half=h//2
    masu=(amari+half)*ki+half*gu
    #arr=list(map(int, readline().strip().split()))
    #n=int(readline().strip())
    print(masu)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
hei,wid=map(int,input().split())
s=0
s+=hei*wid
if s%2==0:
    print(s//2)
elif (hei==1 and wid>1) or (hei>1 and wid==1):
    print(1)
elif s%2!=0:
    print(s//2+1)

Submission status: Wrong Answer

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

x = h*w

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

if x%2==0:
  print(int(x/2))
elif x%2 !=0:
  print(int(math.ceil(x/2)+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def Main(H, W):
    if H%2:
        if W%2:
            return H*(W//2)+(H//2+1)
        else:
            return H*(W//2)
    else:
        if W%2:
            return H*(W//2)+H//2
        else:
            return H*(W//2)
                

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, W = list(map(int, input().split()))
h = -(-H//2)
if H%2 != 0:
  ans =0
  for i in range(W):
    if i%2 == 0:
      ans += h
    else:
      ans += h-1
else:
  ans = h * W
print(ans)

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))
    exit(0)
# 片方偶数
if h % 2 == 0 and w % 2 ==1:
    print((h // 2) * (w // 2 + 1) + (h // 2) * (w // 2))
    exit(0)
if h % 2 == 1 and w % 2 ==0:
    print((h // 2 + 1) * (w // 2) + (h // 2) * (w // 2))
    exit(0)
else:
    print(h * w / 2)
    exit(0)

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

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

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, input().split())
if 1 in [H, W]:
  print(1)
  exit()
print(H * W // 2) if H%2==0 else print(H * W // 2 + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)