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: Runtime Error

Solution code:
import math

a,b = map(int,input().split())

c = a*b/2
print(c)
~                                                                               
~

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import * as fs from "fs";

const [H, W] = fs.readFileSync("/dev/stdin", "utf8").split(" ").map(Number);

function solve(H: number, W: number): number {
	if (H == 1 || W == 1) {
		return 1;
	}
	if (H%2 == 0) {
		return Math.floor(H/2)*W;
	} else {
		let H1 = Math.floor(H/2);
		let H0 = H1+1;
		if (W%2 == 0) {
			return (H0+H1)*Math.floor(W/2);
		} else {
			let W1 = Math.floor(W/2);
			let W0 = W1+1;
			return W0*H0+W1*H1;
		}
	}
}

console.log(solve(H, W));

Submission status: Runtime Error

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: Runtime Error

Solution code:
#B - Bishop △(TLE,WA)
H,W = map(int,input().split())

count = 0
if H == 1 or W == 1:#コーナーケース(H,Wが1の時どこにも動けない)
if H % 2 == 0:
    count = (H // 2)*W
else :
    count = (H // 2)*W + ((W + 2 - 1) // 2)#x/yの切り上げ:(x+y-1)//y
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h = int(input())
w = int(input())
vert = int(h/2)
horiz = int(w/2)
squares = vert*horiz
answer=0
answer+=(squares*2)
answer+=((h%2)*horiz+(w%2)*vert)

if(h%2 and w%2):
 print(answer+1)
else:
 print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#6
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: Runtime Error

Solution code:
def resolve():
    '''
    code here
    '''
    H, W = [int(item) for item in input().split()]

    if H == 1 or W == 1:
        res = 1
    elif H % 2 == 1 and W % 2 == 1:
        res += H * W // 2 +1
    else:
        res = H * W // 2

    print(res)
if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
h = int(input())
w = int(input())
h *= w
if h == 1:
  print(1)
else:
  h = h / 2 + h ℅ 2
  print(h)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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

a = h*w

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

Submission status: Runtime Error

Solution code:
import numpy as np
h,w = map(int,input().split())
bi = np.zeros((h, w))
for i in range(h):
  if(i % 2 != 0 ):
    for j in range(w):
      if(j % 2 != 0):
        bi[i][j] = 1
      else:
        bi[i][j] = 0
  else:
    for k in range(w):
      if(k % 2 == 0):
        bi[i][k] = 1
      else:
        bi[i][k] = 0
print(np.count_nonzero(bi))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print((H+W)/2)

Submission status: Runtime Error

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

if H==1 and W==1:
  print(1)
else:
  print(int(ceil(h*w/2)))

Submission status: Runtime Error

Solution code:
import decimal
H,W=input().split()
h=decimal.Decimal(H)
w=decimal.Decimal(W)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
H,M = map(int,input().split())
if H == 1 or M ==1 :
    print(1)
else :
    prnt(math.ceil((H*M)/2))

Submission status: Runtime Error

Solution code:
H,M = map(int,input().split())
if H == 1 or M ==1 :
    print(1)
else :
    prnt(round((H*M)/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H,M = map(int,input().split())
if M//2 == 0 :
    print(int(H*M/2))
else :
    prnt(int(H*M/2) + round(H/2))

Submission status: Runtime Error

Solution code:
H,W=map(int,input())
cnt=0
for i in range(H):
    for j in range(W):
        if i+j % 2 ==0:
            cnt+=1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h = int(input(""))
w = int(input(""))
if h*w % 2 == 0:
    print(h*w/2)
if h*2%2 == 1:
    print((h*w+1)/2)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

count = ((h //2) * m) + ((h %2) *((m //2) + (m %2))
print(count)

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
print([1,sum(divmod(h*w), 2)][h>0<w])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
div,mod=divmod(h*w)
print(div+mod)

Submission status: Runtime Error

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

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

else:
    print(((h*W) + 1) // 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w = map(int, raw_input().split(' '))
def f(h,w):
	x = w - w/2
	y = w/2
	count = 0
	count += (h - h/2) * x
	count += (h/2) * y
	return count
		


print f(h,wa)

Submission status: Runtime Error

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

if W % 2 == 0:
  num_w = W % 2
else:
  num_w = W % 2 - 1

if H % 2 == 0:
  num_h = H % 2
  
else:
  num_h = H % 2 - 1
  
print(num_w*num_h)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if W % 2 == 0:
  res = H * W / 2
else:
  res =  H * (W//2) + int(H/2) + 1
print('{0:d}'.format(res))

Submission status: Runtime Error

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

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

    if (h==0 and w == 0):
        print((2*(H//2))*(W//2))

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

    if (h ==0 and w !=0):
        print((2*(H//2))*(W//2) + H//2)

Submission status: Runtime Error

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

sum = float(H*W)

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

Submission status: Runtime Error

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

x = H * W

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

Submission status: Runtime Error

Solution code:
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

Submission status: Runtime Error

Solution code:
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
提出情報

Submission status: Runtime Error

Solution code:
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
 
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

Submission status: Runtime Error

Solution code:
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*(int(wei/2)+1)+int(wei/2+1)-1))
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

Submission status: Runtime Error

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

if h == 1 or w ==1:
  ans += 1

elif:
    #奇数行目+偶数行目
    ans += math.ceil(h/2)*math.ceil(w/2)+(h//2)*(w//2)
 
print(ans)

Submission status: Runtime Error

Solution code:
import math
a,b=map(int,input().split())
if a==1|| b==1:
  k=1
elif:
	k=math.ceil((a*b)/2)
print(k)

Submission status: Runtime Error

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
from fractions import gcd
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    # 到達していないところはFalseにしとこう
    h,w = readInts()
    Field = [[0] * w for _ in range(h)]
    d = deque()
    # 最初左上にいるらしい
    # 移動方向 diagonaaaaaaal!
    dx = [-1,-1,1,1]
    dy = [-1,1,-1,1]
    # dfsしたい
    d.append([0,0]) # 初期値を入れる
    cnt = 0
    while d:
        x,y = d.pop()
        Field[y][x] = 1
        #cnt += 1
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if nx < 0 or w <= nx or ny < 0 or h <= ny:
                continue
            if Field[ny][nx] == 0:
                continue
            # 探索済みならいかない
            d.append([nx,ny])
    for x in range(w):
        for y in range(h):
            if Field[y][x] == 1:
                cnt += 1
    print(cnt)
if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
inp=[int(x) for x in input().split()]
n,m=inp[0],inp[1]
print(int(n*m/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
import sys

input = sys.stdin.readline

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

List = list(range(W))
count = 0

for i in range(W):
    if List[i]%2 == 0:
      count +=1

if W%2 ==0:
  Answer = count*H
else:
  if H%2 ==0:
    Answer = count*H - H/2
  else:
    Answer = count*H - (H-1)/2

print(int(Answer))

Submission status: Runtime Error

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

List = list(range(W))
count = 0

for i in range(W):
    if List[i]%2 == 0:
      count +=1

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

print(int(Answer))

Submission status: Runtime Error

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

List = list(range(W))
count = 0

for i in range(W):
    if List[i]%2 == 0:
      count +=1

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

print(Answer)

Submission status: Runtime Error

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

if M == 1 or N == 1:
  print(1)
  break
  if M * N % 2 == 1:
    print(M * N // 2 + 1)
  elif M*  N % 2 == 0:
    print(M * N // 2)

Submission status: Runtime Error

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

if M*N % 2 == 1:
  print(M*N // 2 + 1)
elif M*N % 2 == 0:
  print(M*N // 2)
else M == 1 or N == 1:
  print(0)

Submission status: Runtime Error

Solution code:
# 4 5
import math
field = [int(i) for i in input().split(" ")]
field_num = field[0] * field[1]
if field_num[0] == 1 or field_num[1] == 1:
    print(1)
else:
    canFillBlock = 0
    canFillBlock += math.ceil(field[1]/2) * math.ceil(field[0]/2)
    canFillBlock += math.floor(field[1]/2) * math.floor(field[0]/2)
    print(canFillBlock)

Submission status: Runtime Error

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

print(int(H*W/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(1)
else:
  print(a*b // 2+1)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(0)
elif a*b % 2 == 0:
  print(a*b // 2)
else:
  print(a*b // 2 + 1)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if a*b % 2 == 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
if a*b % 2 = 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())

count = 0
if y % 2 == 0:
	count = x * (y // 2)
elif y == 1
	count = 1
else:
	count = x * ((y + 1) // 2) - (x // 2)

print(count)

Submission status: Runtime Error

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

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ceil(w/2) * ceil(h/2) * (floor(w/2) * floor(h/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

l = [int(x) for x in input().split]

print(math.ceil(l[0]*l[1]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if h == 1 or w == 1:
    print(1)
else:
    hc = (w+1) // 2
    hc2 = w // 2
    d, m = divmod(h, 2)
    ans = d * (hc + hc2) + m * hc

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np


h,w = list(map(int,input().split()))
if h == 1 or w == 1:
    print(1)
else
    print( int(np.ceil(h*w/2)))

Submission status: Runtime Error

Solution code:
num = input().split(" ")
ki = int(num[1]) - gu
gu = int(num[1]) // 2
sum_kaku = 0
a = 0
while a < int(num[0]):
  if a % 2 == 0:
    sum_kaku += ki
  else:
    sum_kaku += gu
  a += 1
print(sum_kaku)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter

stdin = open("sample.txt")

h, w = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Runtime Error

Solution code:
h,w = int(input())
H = int((h+1)/2)
W = int((w+1)/2)
if w == 1:
    print(1)
elif w%2 == 0:
    print(H*(w/2))
else:
    print(H*W + (H-1)*(W-1))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
H,M=map(int, input().split())
t=min(H,M)
m=max(H,M)
if t//2==0:
  return t**2/4+(m-t)*t/2
else:
  if m//2==0:
    n=(t-1)/2
    return 2*n**2+2*n+1+(m-t)*n+(m-t-1)/2
  else:
    return 2*n**2+2*n+1+(m-t)*t/2

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

S = (H * M)
if S %% 2 == 1:
  S = (S+1) / 2
  S = int(S)
  print(S)
else:
  S = S / 2
  S = int(S)
  print(S)

Submission status: Runtime Error

Solution code:
tate, yoko = int(input()).split()
number = tate * yoko // 2
if (tate * yoko % 2 == 0):
  print(number)
else:
  number = number + 1
  print(number)

Submission status: Runtime Error

Solution code:
tate = int(input(''))
yoko = int(input(''))
number = tate * yoko // 2
if (tate * yoko % 2 == 0):
  print(number)
else:
  number = number + 1
  print(number)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
  int H,W;
  cin >> H >> W;
  if (min(H,W) == 1){
    cout << 1 <<endl;
    return 0;
  }
  
  ll n = H*W;
  ll ans = (n+1)/2;
  cout << ans << endl;
  return 0;
  
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

hw=h*w
tmp1,tmp2=divmod(hw,2)
if(tmp2 == 0):
  print(tmp1)
  end()
else:
  print(tmp1+1)

Submission status: Runtime Error

Solution code:
H=int(input(())
W=int(input(())
if H*W % 2 == 0:
    print(H*W/ 2)

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

Submission status: Runtime Error

Solution code:
H=input(int())
W=input(int())
if H*W %= 0:
    print(H*W/ 2)

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

Submission status: Runtime Error

Solution code:
import sys
 
input = sys.stdin.readline
H, W = list(map(int,input().split()))
 
if H==1 or W==1:
    print(1)

ans =(A*B+1)//2
print(ans)

Submission status: Runtime Error

Solution code:
import sys
 
input = sys.stdin.readline
H, W = list(map(int,input().split()))
 
if H==1 of W==1:
    print(1)

ans =(A*B+1)//2
print(ans)

Submission status: Runtime Error

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

if h == 1 or w == 1;
    a = 1
elif h % 2 == 0:
    a = int(h * w / 2)
else:
    a = int(w * (h+1)/2) - int(w/2)

print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h w = input()
if h*w == 0:
  print(h*w/2)
 else:
  print(h*w//2+1)

Submission status: Runtime Error

Solution code:
print((int(input())+1)//2*(int(input())+1)//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
inport math
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print(math.ceil(h*w/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if H == 1 or W == 1:
  return 1
else:
  cnt = (H * W + 1) // 2
  return cnt

Submission status: Runtime Error

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

ban = []

for j in range(W):
  ban.append(0)

banmen=[]

for i in range(H):
  banmen.append(ban)
  
banmen[0][0] = 1
cnt = 1

for i in range(H):
  for j in range(W):
    if banmen[i][j] != 1:
      continue
    if i-1 >= 0 and j-1 >= 0 and banmen[i-1][j-1] != 1:
      banmen[i-1][j-1] = 1
      cnt+=1
    elif i-1 >= 0 and j+1 <= len(ban) and banmen[i-1][j+1] != 1:
      banmen[i-1][j+1] = 1
      cnt+=1
    elif i+1 <= H and j-1 >= 0 and banmen[i+1][j-1] != 1:
      banmen[i+1][j-1] = 1
      cnt+=1
    elif i+1 <= H and j+1 <= W and banmen[i+1][j+1] != 1:
      banmen[i+1][j+1] = 1
      cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
a,b=int(input().split)
c=(a*b)
if c%2!=0:
  ans=(c/2)+1
else:
  ans=(c/2)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def bishop(H, W):
    if H==1 or W== 1:
        return 0
    result  = int((H-1)/2 + 1) * int((W-1)/2 + 1) + int(H/2) * int(W/2)
    return result
ans = input().split(" ")
H = int(ans[0])
W = int(ans[1])
print(bishop(H,W)

Submission status: Runtime Error

Solution code:
ans = input().split(" ")
H = ans[0]
W = ans[1]
result  = int((H-1)/2 + 1) * int((W-1)/2 + 1) + int(H/2) * int(W/2)
print(result)

Submission status: Runtime Error

Solution code:
ans = input().split(" ")
H = ans[0]
W = ans[1]
result  = int((H-1)/2 + 1) * int((W-1)/2 + 1) + int(H/2) * int(W/2)

Submission status: Runtime Error

Solution code:
h=int(input())
w=int(input())

s=ceil(h/2.0)*ceil(w/2.0)+floor(h/2.0)*floor(w/2.0)

print(s)

Submission status: Runtime Error

Solution code:
h=int(input())
w=int(input())

print(ceil(h/2.0)*ceil(w/2.0)+floor(h/2.0)*floor(w/2.0))