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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if x==1 or y==1:
  print(1)
else:
  print((x*y+1)//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if h == 1 or m == 1:
    count = 1
else:
    count = ((h //2) * m) + ((h %2) *((m //2) + (m %2)))
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
from sys import stdin
H, W = [int(_) for _ in stdin.readline().rstrip().split()]
if H == 1 or W == 1:
    print(1)
else:
    print(ceil(H*W/2))

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# 奇数行目は(W/2)+1. 偶数行目は(W/2)+1
H, W = map(int, input().split())
block_num = H*W

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

Submission status: Accepted

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

if h==1 or w==1:
    print(1);exit()
tmp = (h*w)//2+(h*w)%2
print(tmp)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np

H, W = MAP()
if H == 1 or W == 1:
	print(1)
else:
	print(-(-H*W//2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if h == 1 or w == 1:
  print(1)
else:
  if h % 2 == 1 and w % 2 == 1:
    t = t + 1
  print(int(t/2))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

# In[12]:


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


# In[14]:


if H == 1 or W == 1:
    ans = 1
else:
    ans = -(-H*W//2)
print(ans)


# In[ ]:

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
H, W = list(map(int, input().split()))
### 片方だけ奇数のマスには行くことができない
### Hが偶数、Wが偶数の場合 → H*W // 2
### Hが奇数、Wが偶数の場合 → H*W // 2 (Wが奇数の場合も同様)
### Hが奇数、Wが奇数の場合 → H*W // 2 + 1
if H == 1 or W == 1:
    print(1)
elif H % 2 != 0 and W % 2 != 0:
    print(int(H * W // 2) + 1)
else:
    print(int(H * W // 2))

Submission status: Accepted

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

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

Submission status: Accepted

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

if((H != 1)and(W != 1)):
  cnt1 = ((H+1)//2)*((W+1)//2)
  cnt2 = (H//2)*(W//2)
  ans = cnt1 + cnt2
else:
  ans = 1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


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


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


H, W = mi()

# 移動できない
if H == 1 or W == 1:
    print(1)
# 縦偶数
elif H % 2 == 0:
    print(H * W // 2)
# 縦奇数 かつ　横偶数
elif W % 2 == 0:
    print(H * W // 2)
# 縦奇数 かつ　横奇数
else:
    print((H * W // 2) + 1)

Submission status: Accepted

Solution code:
il = [int(k) for k in input().split()]

H = il[0]
W = il[1]
# H : 縦
#  W : 横

import math

a = math.ceil(W/2)
b = math.floor(W/2)
c = math.ceil(H/2)
d = math.floor(H/2)

if H == 1 or W == 1:
    print("1")
else:
    print(a*c + b*d)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
H,W= LI()

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

Submission status: Accepted

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


def solve(H: int, W: int):
    if W == 1 or H == 1:
        # coner case
        print(1)
    else:
        print(math.ceil(W * H / 2))
    return


# Generated by 1.1.7.1 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: Accepted

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

Solution code:

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

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

Submission status: Accepted

Solution code:
from math import ceil

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

h, w = [int(x) for x in stdin.readline().strip().split()]
if(h == 1 or w == 1):
  print(1)
else:
  print((h//2)*(w//2)+((h+1)//2)*((w+1)//2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
H,W = list(map(int,input().split()))
if H == 1 or W == 1:
  print(1)
  exit()
HE = H//2
HO = H - HE
WE = W//2
WO = W - WE
print(HO*WO+HE*WE)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

w1=0--W//2
w2=W//2

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

Submission status: Accepted

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

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

Submission status: Accepted

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



def fun():
    if int(m/2) == m/2:
        ans = n*m/2
    else:
        if int(n/2)==n/2:
            ans = n*m/2
        else:
            ans = (n*m/2)+0.5
    
    print(int(ans))  
    
if n == 1 or m ==1:
    print("1")
else:
    fun()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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


h, w = invr()

c = (int((h+1)/2)*w)
if h % 2 != 0:
    c = c - (w-1)/2
if h == 1 or w == 1:
    c = 1
print(int(c))

Submission status: Accepted

Solution code:
import math
from collections import deque
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

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

Submission status: Accepted

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

h1 = H//2
h2 = H-h1

w2 = W//2
w1 = W-w2

if H==1 or W==1:
  print(1)
else:
  print(h2*w1+h1*w2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

H, W = [int(i) for i in input().split()]
if H == 1 or W == 1:
    print(1)
else:
    print(math.ceil(H * W / 2))

Submission status: Accepted

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

hh = h%2
kk = k%2

if h == 1 or k == 1:
    ans = 1
elif hh == 0 or kk == 0:
    ans = int(h*k/2)
else:
    ans = int(h*k/2)+1

print(ans)

Submission status: Accepted

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



if x ==1 or y ==1:
  print(1)
  exit(0)
if x%2==0 or y%2==0:
  print(int(x/2*y))
  exit(0)
a=int(x*y/2)+1
print(a)

Submission status: Accepted

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

if H==1 or W==1:
  ans = 1
else:
  ans = math.ceil(H/2)*math.ceil(W/2) + math.floor(H/2)*math.floor(W/2)

print(ans)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

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

s = 0

if h == 1 or w == 1:
    s = 1
else:
    s = h*w//2 + h*w % 2

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
h,w = map(int,input().split())
neko = h%2
nya = w%2
nuko = h * w /2
if neko + nya == 2:
    nuko = nuko + 1
if (h == 1)or(w == 1):
    nuko = 1
print(int(nuko))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if h == 1 or w == 1:
    print(1)
else:
    odd = ((h + 1)//2)  * ((w + 1)//2)
    even = (h//2) * (w//2)
    print(odd + even)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0 

ans += H//2*W

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

Submission status: Accepted

Solution code:
import math

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

if h == 1 or w == 1:
    print(1)
else:
    print(math.ceil(h * w / 2))

Submission status: Accepted

Solution code:
h,w = map(int, raw_input().split(' '))
def f(h,w): return 1 if h == 1 or w == 1 else (h - (h/2)) * ((w - w/2)) + ((h/2)) * (w/2)
print f(h,w)

Submission status: Accepted

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


print f(h,w)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

w1, w2 = W // 2, W % 2
h1, h2 = H // 2, H % 2

if H > 1 and W > 1:
	num = 2 * w1 * h1 + w2 * h1 + w1 * h2 + w2 * h2 
else:
  num = 1
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
h , w = map(int , input().strip().split())
if h != 1 and w != 1:
  print(math.ceil(h * w / 2))
else:
  print(1)

Submission status: Accepted

Solution code:
import math

def resolve():
  H, W = [int(i) for i in input().split()]
  if H==1 or W==1:
    print(1)
  else:
    print(math.ceil(H*W/2))
    
resolve()

Submission status: Accepted

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


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

import math

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

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

import math

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

w_can = W // 2
ans = w_can * H
if W % 2 != 0:
    ans += math.ceil(H / 2)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def solve(H,W):
    if H==1 or W==1:
        return 1
    ans = (H*W+1)//2
    return ans
print(solve(H,W))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem B - Bishop

import math

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

# check
if H==1 or W==1:
    print(1)
else:
    ans = math.ceil(H * W / 2)
    print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

if h == 1 or w == 1:
  print(1)
else:
  print(int(np.ceil(h*w/2)))

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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