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:
def main(w,h):
    x1 = int(w/2 if w%2 == 0 else (w+1)/2)
    x2 = int(w/2 if w%2 == 0 else (w-1)/2)
    if(h%2 == 0):
        res = (h/2)*(x1+x2)
    else:
        res = ((h-1)/2)*(x1+x2) + x1
    return int(res)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dep = h // 2
wid = w // 2

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

Submission status: Wrong Answer

Solution code:
a,b=(int(x) for x in input().split())
print(int((a*b+1)//2))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import ceil
H, W = map(int, input().split())
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==1 or W==1:
  print(1)
else:
  if H%2==0:
    print(int((H/2)*W))
  else:
    first=(H//2)+1
    sec=first-1
    if W%2==0:
      print((first+sec)*(W/2))
    else:
      print((first+sec)*(W//2)+first)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np

n,w = map(int, input().split())
# n = int(input())
# p = list(map(int, input().split()))
ans = 0

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

else:
    ans = (n * w) // 2 + 1

print(ans)

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 or wid==1:
    print(0)
else:
    print(s//2+1)

Submission status: Wrong Answer

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

result = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % 2 == 1 and b % 2 == 1:
  print(a*b//2 + 1)
else:
  print(a*b//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
c = a*b
if a==1 or b==1:
    print(0)
    exit()

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import math

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

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

Submission status: Wrong Answer

Solution code:
import math

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

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

Submission status: Wrong Answer

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

x = h*w

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

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

Submission status: Wrong Answer

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

print(int((h * w) / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(((W + 1) // 2) * ((H + 1) // 2) + ((W) // 2) * (H // 2))

Submission status: Wrong Answer

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

input_num = input().split(" ")
H = int(input_num[0])
W = int(input_num[1])

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

Submission status: Wrong Answer

Solution code:
def split(x):
    rtn = []
    for y in x.split(" "):
        if y.isdigit():
            rtn.append(int(y))
        else:
            rtn.append(y)
    return rtn

h, w = split(input())
total = int(h * w / 2) + (h * w) % 2
print(total)

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

print(ceil(H * W / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 

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

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H == 1 or W == 1:
    print(0)
    exit()
    
print(math.ceil((H * W) / 2))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:



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


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

Submission status: Wrong Answer

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

up = (W + 1) // 2
dn = W // 2

ans = (up + dn) * (H // 2)
if H % 2 == 1:
    ans += up

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from math import ceil

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

print(ceil(n/2) * ceil(m/2) + (n//2) * (m//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	H, W = map(int, input().split())

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

	print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

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

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

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

print(X)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# import math
# a, b, c = map(int, input().split())
# # k = list(map(int, input().split(",")))

# if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
#     print("Yes")
# else:
#     print("No")

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

hw  = h*w

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
s = input().split(' ')
h = int(s[0])
w = int(s[1])
w1 = math.ceil(w/2)
w2 = math.trunc(w/2)
h1 = math.ceil(h/2)
#print(h, w)
print(h1*w1 + (h-h1)*w2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    half_H = H // 2
    even = half_H * (W // 2)
    odd = (H - half_H) * ((W + 1) // 2)

    print(even + odd)
    
resolve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W=map(int, raw_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())
A=H*W
if A%2==0:
	print(A//2)
else:
	print((A+1)//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cnt = 0
for i in range(w):
    if (i + 1) % 2 == 1:
        cnt += 1
a, b = divmod(h, 2)
ans = (cnt + (cnt - 1)) * a + (cnt) * b
print(ans)

Submission status: Wrong Answer

Solution code:
def resolve():
    H, W = map(int, input().split())  
    
    sum_number = 0

    W_odd = int(W / 2)
    W_even = W - W_odd

    H_odd = int(H / 2)
    H_even = H - H_odd

    sum_number += (W_odd * H_odd + W_even * H_even)

    print(sum_number)

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    res = H * W

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

    res //= 2

    print(res)



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:

def ceil(a, b):
    return -(-a // b)


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math

h = list(map(int, input().split()))
print(math.ceil(h[0] * h[1] / 2))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
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%2==0 and w%2==0:
    print(h*w//2)
if (h+w)%2!=0:
    print(h*w//2)
if h%2!=0 and w%2!=0:
    num=(min(h,w)-1)
    num1=(max(h,w)+1)//2
    ans=num*num1+(num1-1)*(min(h,w)-num)
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
w1 = -(-W//2)
w2 = W - w1

h1 = -(-H//2)
h2 = H - h1

print(w1*h1 + w2*h2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
h, w = [int(i) for i in input().split()]
a = (h + 1) // 2
b = h // 2
c = (w + 1) // 2
d = w // 2
print(a*c+b*d)

Submission status: Wrong Answer

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

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

if H % 2 == 0:
    ans = (H * W // 2)
else:
    if W % 2 == 0:
        ans = (2 * H - 1) * (W // 2)
    else:
        _H = (H + 1) // 2
        ans = (2 * _H - 1) * (W // 2) + _H
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:
import math
a, b = list(map(int, input().split()))

if a == 2 and b == 2:
    print(1)
    exit() 
r = math.ceil(a*b/2)
print(r)

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

if (w % 2) == 0:
    wss = w//2
else:
    wss = w//2

hs = -1
hss = -1

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

if (h % 2) == 0:
    hss = h//2
else:
    hss = h//2

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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


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())
if h == 1 or w == 1:
  print(1)
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:
H,W=map(int,input().split())

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

Submission status: Wrong Answer

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

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 / 2)
    
print(count)

Submission status: Wrong Answer

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

print(int((H*W+1)/2))

Submission status: Wrong Answer

Solution code:
h,w = map(int,input().split())
if h %2 == 0:
    print(int(h*w /2))
else:
    tmp = (h+1)/2#多いほうの行けるマス数
    tmp1 = (h-1)/2#少ないほうの行けるマス数
    if w %2 == 0:
        print(int((tmp+tmp1)*w/2))
    else:
        print(int((tmp+tmp1)*(w-1)/2 + tmp))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H = int(H)
W = int(W)

t = H * W

mod = t % 2

if mod == 0:
    print(t/2)
else:
    print(int(t/2) + 1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

print(int(SUM))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    (h, w) = [int(e) for e in lines[0].split(" ")]

    return (h, w)


def solve(h, w):

    cell = h * w
    if cell == 1:
        return 1
    elif cell == 2:
        return 1

    tmp = cell // 2
    result = None
    if cell % 2 == 0:
        result = tmp
    else:
        result = tmp + 1
        

    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Wrong Answer

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

oneloop = w

rest = (w-w//2)

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

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

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
if (a*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)
elif H == 1 or W == 1:
  print(1)
else:
  print((H*W)//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(H * W // 2 + min(H % 2, W % 2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

def solve(H: int, W: int):
    count = 0
    if H % 2 == 0:
        count += (H / 2) * math.ceil(W/2) 
        count += (H / 2) * math.floor(W/2) 
    else:
        count += (1 + (H // 2)) * math.ceil(W/2)
        count += (H // 2) * math.floor(W/2) 

    count = int(count)
    assert type(count) == int
    print(count)
    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:
h, w = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:

def submit():
    h, w = map(int, input().split())
    
    even_c = sum(divmod(w, 2))
    odd_c = w // 2
    even_row = sum(divmod(h, 2)) * even_c
    odd_row = (h // 2) * odd_c

    print(even_row + odd_row)


if __name__ == "__main__":
    submit()

Submission status: Wrong Answer

Solution code:
import sys

import math

input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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*(y//2+1)+b*(y//2))

Submission status: Wrong Answer

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

HH = H // 2
hh = H % 2
WW = W // 2
ww = W % 2

a = 0

a += HH * WW * 2
a += hh * WW
a += HH * ww
a += hh * ww

print(a)

Submission status: Wrong Answer

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

if h % 2 == 0:
    tate = h // 2
    print(tate * w)
    exit(0)
else:
    tate1 = h // 2
    tate2 = tate1 + 1
    if w % 2 == 0:
        print(tate1 * (w // 2) + tate2 * (w // 2))
    else:
        yoko1 = w // 2
        yoko2 = yoko1 + 1
        print(tate1 * yoko1 + tate2 * yoko2)
        exit(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

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

if __name__ == '__main__':
    main()