Problem:


Score : 200 points

Problem Statement

We have a board with H horizontal rows and W vertical columns of squares.
There is a bishop at the top-left square on this board.
How many squares can this bishop reach by zero or more movements?

Here the bishop can only move diagonally.
More formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:

r_1 + c_1 = r_2 + c_2

r_1 - c_1 = r_2 - c_2

For example, in the following figure, the bishop can move to any of the red squares in one move:

Constraints

1 \leq H, W \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H \ W

Output

Print the number of squares the bishop can reach.

Sample Input 1

4 5

Sample Output 1

10

The bishop can reach the cyan squares in the following figure:

Sample Input 2

7 3

Sample Output 2

11

The bishop can reach the cyan squares in the following figure:

Sample Input 3

1000000000 1000000000

Sample Output 3

500000000000000000



Sample input:
4 5


Sample output:
10

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

    print(ans)


main()

Submission status: Wrong Answer

Solution code:
line = input()
H = int(line.split()[0])
W = int(line.split()[1])

ans = (W // 2 + W % 2) * (H // 2 + H % 2) + (W // 2) * (H // 2)
print(ans)

Submission status: Wrong Answer

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

if h%2 == 0 and w%2 ==0:
    # ok
    ans = int(w//2) * h
elif h%2 != 0 and w%2 !=0:
    # ok
    tmp = w//2 + 1
    tmp2 = tmp-1
    ans = tmp * (h//2+1) + tmp2 * h//2
elif h%2 != 0 and w%2 == 0:
    
    ans = int(w//2) * h
elif h%2 == 0 and w%2 != 0:
    # ok
    tmp = w//2 + 1
    tmp2 = w//2
    ans = tmp * (h//2) + tmp2 * h//2

print(int(ans))

Submission status: Wrong Answer

Solution code:
datas = input().split(" ")

h = int(datas[0])
w = int(datas[1])


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

Submission status: Wrong Answer

Solution code:
import math
n,k = map(int, input().split())
if  (n)%2 != 0:
    if  (k)%2 != 0:
        print(int(math.floor((n*k)/2)+1))
else:
    print(int((n*k)/2))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

if H > W:
    H, W = W, H

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# num = H * W


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

elif H == 1 or W == 1:
    print("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(ans + (ans-ans//2))
    else:
        num = H // 2
        ans = num * W
        print(ans + (H-(num)))

Submission status: Wrong Answer

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

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)
    else:
        print(0)


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

Submission status: Wrong Answer

Solution code:
import math
a = list(map(int,input().split()))
h = a[0]
w = a[1]

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

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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import math

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n, m = (int(x) for x in input().split())
if n % 2 != 0 and m % 2 != 0:
    print(int((n * m + 1) / 2))
else:
    print(int(n * m / 2))

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

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

main()

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:
h, w = 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:
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)
    return ans

Submission status: Wrong Answer

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


def main():

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
number = input().split(" ")
n_1 = int(number[0])
n_2 = int(number[1])
if n_1 % 2 == 1 and n_2 % 2 == 1:
    syo_1 = (n_1 + 1) // 2
    syo_2 = (n_2 + 2) // 2
    keisan = syo_1 * syo_2 + (syo_1 - 1) * (syo_2 - 1)
elif n_1 % 2 == 1 and n_2 % 2 == 0:
    syo_1 = (n_1 + 1) // 2
    syo_2 = n_2 // 2
    keisan = syo_1 * syo_2 + (syo_1 -1) * syo_2
elif n_1 % 2 == 0 and n_2 % 2 == 1:
    syo_1 = n_1 // 2
    syo_2 = (n_2 + 1) // 2
    keisan = syo_1 * syo_2 + syo_1 * (syo_2 - 1)
else:
    syo_1 = n_1 // 2
    syo_2 = n_2 // 2
    keisan = 2*(syo_1 * syo_2)
print(keisan)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

tmpHbig=int(w/2)
tmpHsmall=int(w/2)
tmpHamari = w%2
if tmpHamari==1:
    tmpHbig+=1

tmpWamari = h%2
bigW = int(h/2)
smallW = int(h/2)
if tmpWamari==1:
    bigW+=1


print((tmpHbig*bigW) + ((tmpHsmall)*smallW))

Submission status: Wrong Answer

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

ans = 0
h2 = -(-h // 2)
kari = h2 * w
if h % 2 == 0:
    ans = kari
else:
    ans = kari - (w // 2)
print(ans)

Submission status: Wrong Answer

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

h, w = na()
c = ((h + 1) // 2) * ((w + 1) // 2)
d = ((h + 1) // 2 - (h % 2)) * (w // 2)
print(c + d)

Submission status: Wrong Answer

Solution code:
arg = input().split(' ')
H = int(arg[0])
W = int(arg[1])

w_odd = (W+1) // 2
w_even = W // 2

h_odd_line = (H+1) // 2
h_even_line = H // 2

reachable = (w_odd * h_odd_line + w_even * h_even_line)
print(reachable)

Submission status: Wrong Answer

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

ws = -1
wss = -1

if (w % 2) == 0:
    ws = w//2
else:
    ws = (w + 1)//2

wss = w//2

hs = -1
hss = -1

if (h % 2) == 0:
    hs = h//2
else:
    hs = (h+1)//2

hss = h//2


# print(ws, wss, hs, hss)
print(ws*hs + wss*hss)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
m,n = map(int,input().strip().split())
if m>n:
    print(math.ceil(m/2*n))
else:
    print(math.ceil(m*n/2))

Submission status: Wrong Answer

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

if n&1:
    n1 = n/2
    n2 = n-n1
else:
    n1 = n2 = n/2
if m&1:
    m1 = m/2
    m2 = m-m1
else:
    m1 = m2 = m/2

ans = max(n1,n2)*max(m1,m2)+min(n1,n2)*min(m2,m1)
print(ans)

Submission status: Wrong Answer

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


def main():

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

    result = w * math.floor(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())

S = h * w

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h%2 == 0 and w%2 ==0:
    # ok
    ans = int(w//2) * h
elif h%2 != 0 and w%2 !=0:
    # ok
    tmp = w//2 + 1
    tmp2 = w//2
    ans = tmp * (h//2+1) + tmp2 * h//2
elif h%2 != 0 and w%2 == 0:
    
    ans = int(w//2) * h
elif h%2 == 0 and w%2 != 0:
    # ok
    tmp = w//2 + 1
    tmp2 = w//2
    ans = tmp * (h//2) + tmp2 * h//2

print(int(ans))

Submission status: Wrong Answer

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

h_floor = H // 2
w_floor = W // 2
h_ceil = H - h_floor
w_ceil = W - w_floor 

ans = h_ceil * w_ceil + h_floor * w_floor
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

H,W = list(map(int,input().split()))
ans = H*W/2
print(math.ceil(ans))

Submission status: Wrong Answer

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

print(result)

Submission status: Wrong Answer

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

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

print(a)

Submission status: Wrong Answer

Solution code:
from math import ceil
a, b = [int(x) for x in input().split()]
print(ceil((a * b)/2))

Submission status: Wrong Answer

Solution code:
datas = input().split(" ")

h = int(datas[0])
w = int(datas[1])


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

Submission status: Wrong Answer

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

odd = W//2 + W%2
even = W//2

odd_all = odd * (H//2 + H%2)
even_all = even * H//2

print(odd_all+even_all)

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('横偶数、縦奇数')
        ans_1 = w / 2 * (h + 1 / 2)
        ans_2 = (w - 1) / 2 * (h / 2)
# 横が奇数のとき
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
        # print(ans_1)
        c = (w - 1) / 2
        # print(c)
        d = (h - 1) / 2
        # print(d)
        ans_2 = c * d
        # print(ans_2)

ans = ans_1 + ans_2

print(math.floor(ans))

Submission status: Wrong Answer

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

if H == 1 or W == 1:
    print(0)
else:

    if H % 2 == 0 and W % 2 == 0:
        #print("d")
        print("{}".format(int(H * (W // 2))))
    elif H % 2 != 0 and W % 2 != 0:  # どっちもきすう
        #print("a")
        print (H * (W // 2) + (H // 2)+1)
    elif H % 2 != 0:
        #print("c")
        print("{}".format(int(H * (W // 2))))
    elif W % 2 != 0:  # Wがきすう
        #print("b")
        print("{}".format(int(H * (W // 2) + (H // 2))))


#500000000000000000
#500000000000000000

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:
from decimal import Decimal, ROUND_FLOOR

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

ans = Decimal(H * W / 2)
print(Decimal(H * W) - ans.to_integral_exact(rounding=ROUND_FLOOR))

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_b
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
hn1 = int((H+1)/2)
hn2 = int((H)/2)
ans = 0
if W%2 == 0:
  ans = int(hn1*W/2) + int(hn2*W/2)
else:
  ans = int(hn1*(W/2+1/2)) + int(hn2*(W/2-1/2))
print(int(ans))

Submission status: Wrong Answer

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

    h1 = (h + 1) // 2
    h2 = h // 2

    #print(h1, h2)
    if w % 2 == 1:
        #print((w // 2 + 1), w // 2)
        print(h1 * (w // 2 + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * w // 2)


if __name__ == "__main__":
    main()

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

all_num = H * W
#奇数か偶数かの判定
compare_num = all_num % 2

if compare_num == 0:
  print(all_num // 2)
else:
  print(all_num // 2 + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

str=input().split(" ")

a= Decimal(str[0])
b=Decimal(str[1])
c=a*b
if c%2 == Decimal(0):
    print(Decimal(c/2))
else:
    print(Decimal(c/2+1))

Submission status: Wrong Answer

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

if H * W %2 != 0:
    ans += 1

print(str(ans))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    h1 = (h + 1) // 2
    h2 = h // 2

    print(h1, h2)
    if w % 2 == 1:
        #print((w // 2 + 1), w // 2)
        print(h1 * (w // 2 + 1) + (h2 * (w // 2)))
    else:
        print((h1 + h2) * 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:
  print((h * w + 1) // 2)
else:
  print(h * w // 2)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
m = (a+1) //2
n = a // 2
c = (b+1) // 2
d = b // 2
x = (m*c)+(n*d)
print(x)

Submission status: Wrong Answer

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

ans = W * (H // 2)

if H % 2 == 1:
    ans += W // 2
    if W % 2 == 1:
        ans += 1

print(ans)

Submission status: Wrong Answer

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


def main():
    h,w = mi()

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H == 1 or W == 1:
    print(0)
else:

    if H % 2 == 0 and W % 2 == 0:
        print("d")
        print("{}".format(int(H * (W // 2))))
    elif H % 2 != 0 and W % 2 != 0:  # どっちもきすう
        print("a")
        print (H * (W // 2) + (H // 2)+1)
    elif H % 2 != 0:
        print("c")
        print("{}".format(int(H * (W // 2))))
    elif W % 2 != 0:  # Wがきすう
        print("b")
        print("{}".format(int(H * (W // 2) + (H // 2))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split())
if a== 1000000000 and b == 1000000000:
  print(500000000000000000)
else:
  c = a+b+1

Submission status: Wrong Answer

Solution code:

def main():
    
    h, w = [int(i) for i in input().split()]
    
    result = 0
    hgusu = h // 2
    hkisu = h - hgusu
    wgusu = w // 2
    wkisu = w - wgusu

    result = hkisu * wkisu + hgusu * wgusu
    print(result)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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 % 2 == 0:
    print((h / 2 * w1) + (h / 2 * w2))
else:
    print(((h + 1) / 2 * w1) + ((h - 1) / 2 * w2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = map(int,input().split())
m, a = divmod(h, 4)
n, b = divmod(w, 4)
print(8*m*n + 2*a*n + 2*m*b + int((a*b+1)/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w=map(int,(input().split()))
r=0
for i in range(h):
    if i % 2 == 0:
        r+=(w+1)//2
    else:
        r+= w//2
print(r)

Submission status: Wrong Answer

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

w2 = W - w1
if H%2 == 0:
  h1 = H//2
else:
  h1 = (H + 1)//2

h2 = H - h1

print(w1*h1 + w2*h2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_b
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
hn1 = int((H+1)/2)
hn2 = int((H)/2)
ans = 0
if W%2 == 0:
  ans = hn1*W/2 + hn2*W/2
else:
  ans = hn1*(W/2+1/2) + hn2*(W/2-1/2)
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = h*w

if num == 1:
    print(1)
elif num % 2 == 1:
    print((num+1)//2)
else:
    print(num//2)

Submission status: Wrong Answer

Solution code:
posx, posy = input().split(" ")

bord = int(posx) * int(posy)
print(bord-int(bord/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:
def main():

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

if __name__ == '__main__':
    print(main())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

N = int(H * W / 2)
# print(int(N))
if H == 1 or W == 1:
    print(1)
elif H * W % 2 != 0:
    print(N + 1)
else:
    print(N, ":")

Submission status: Wrong Answer

Solution code:
H, W = [int(i) for i in input().split()]
h1 = (H+1) // 2
w1 = (W+1) // 2

h2 = H // 2
w2 = W // 2

result = int( h1*w1 + h2*w2 )
print(result)

Submission status: Wrong Answer

Solution code:
def inpl(): return list(map(int, input().split()))

H, W = inpl()

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