Problem:


Score : 200 points

Problem Statement

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

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

r_1 + c_1 = r_2 + c_2

r_1 - c_1 = r_2 - c_2

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

Constraints

1 \leq H, W \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H \ W

Output

Print the number of squares the bishop can reach.

Sample Input 1

4 5

Sample Output 1

10

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

Sample Input 2

7 3

Sample Output 2

11

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

Sample Input 3

1000000000 1000000000

Sample Output 3

500000000000000000



Sample input:
4 5


Sample output:
10

Submission status: Wrong Answer

Solution code:
H, W = [int(x) for x in 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:
n,w = map(int,input().split())

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

H, W = map(int, input().split())
if H >= 2 and W >= 2:
    ans = math.ceil(H / 2) * math.ceil(W / 2) + (H // 2) * (W // 2)
else:
    ans = 0
print(ans)

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()

if W % 2 == 0:
    a = W // 2
    b = W // 2
else:
    a = W // 2 + 1
    b = W // 2
# a = ceil(W / 2)
# b = ceil((W-1) / 2)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input().split(" ")
b = int(a[0])
c = int(a[1])

minimum = min(b,c)
masnum = b*c

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil,floor
h,w=[int(i) for i in input().split()]
print(ceil(h*w/4)+floor(h*w/4))

Submission status: Wrong Answer

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

ans = 0

for i in range(h):
    if(i % 2 == 0):
        if (w % 2 == 0):
            ans += w // 2
        else:
            ans += w // 2 + 1
    else:
        ans += w // 2

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math
h, w = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a,s,f,d=n//2,n-n//2,m//2,m-m//2
print(a*f+s*d)

Submission status: Wrong Answer

Solution code:
k = input()

h, w = k.split(' ')

r = int(h) * int(w)

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

Submission status: Wrong Answer

Solution code:
import math

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

total = 0
total += math.ceil(H/2) * math.ceil(W/2)
total += math.floor(H/2) * math.floor(W/2)

print(total)

Submission status: Wrong Answer

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

num = h*w

if h % 2 == 1 and w % 2 == 1:
    print((num+1)//2)
else:
    print(num//2)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h,w = (int(x) for x in input().split())
print((h//2+h%2)*(w//2+w%2)+(h//2)*(w//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def S(): return input()


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


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    H, W = MI()
    h = 0
    w = 0
    ans = 0

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

    # for i in range(H):
    #     if i % 2 == 0:
    #         ans += W // 2 + 1
    #     else:
    #         ans += W // 2

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = [int(x) for x in input().split()]
print(-(-H * W //2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m,n=map(int,input().split())
k=(m+1)//2
j=(n+1)//2
h=m//2
g=n//2
print(k*j+h*g)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    H, W = map(int, input().split())
    even = ((W + 1) // 2 if W % 2 == 1 else W // 2)
    odd = W // 2 
    if H % 2 == 1: Ans = (even * (H + 1) // 2) + (odd * H // 2)
    else: Ans = even * H // 2 + odd * H // 2
    print(Ans)

    return 0

if __name__ == "__main__":
    solve()

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b= list(map(int,input("\nEnter the numbers : ").strip().split()))
x=a*b
if(x%2!=0):
	x=x+1
print(x//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

H, W = map(int, input().split())
if H > 2 and W > 2:
    ans = math.ceil(H / 2) * math.ceil(W / 2) + (H // 2) * (W // 2)
else:
    ans = 0
print(ans)

Submission status: Wrong Answer

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

num = h * w

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
#from functools import lru_cached
from heapq import heappop,heappush
import time
import os
import sys
import datetime
readline=readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#main
H,W=map(int,input().split())
a=(W-W//2)*(H-H//2)
b=(W//2)*(H//2)
print(a+b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def solve(H: int, W: int):
    print(int((H/2)*W) if H%2==0 else int((H//2)*W+math.ceil(W/2)))
    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:
a, b = map(int, input().split())
if a+b % 2 == 0:
  out = int(a*b/2)
else:
  out = int((a*b+1)/2)
print (out)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if h % 2 == 0 and w % 2 == 0:
    print(h * w // 2)
    exit()

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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


def solve(H: int, W: int):
    first = W//2 if W%2 == 0 else (W//2)+1
    second = W//2

    if H%2 == 0:
        print(first*(H//2)+second*(H//2))
    else:
        print(first*(H//2+1)+second*(H//2))
    return


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H, W = [int(i) for i in input().split()]
n_odd = ((W+1)//2) * ((H+1)//2)
n_even = (W//2) * (H//2)
print(n_odd + n_even)

Submission status: Wrong Answer

Solution code:
import math

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

a1 = math.floor(h / 2)
a2 = math.ceil(h / 2)
b1 = math.floor(w / 2)
b2 = math.ceil(w / 2)


print((a1 * b1) + (a2 * b2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N,M = list(map(int,input().split()))
print (math.ceil(N*M/2))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n,m = (int(x) for x in input().split())

mul = int(n*m)

if mul % 2 == 1:
    print(mul // 2 + 1)
elif mul % 2 == 0:
    print(mul //2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = inp[0]*inp[1]

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

print(b)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

cell = nums[0] * nums[1]
if cell % 2 == 0:
  print(int(cell / 2))
else:
  print(int(math.ceil(cell / 2)))

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

ans = 0

ans += int(h / 2) * int(w / 2)
ans += (h - int(h / 2)) * (w - int(w / 2))

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if H%2 ==1 and W%2 ==1:
    ans = H*W//2+1
else:
    ans = H*W//2

print(ans)

Submission status: Wrong Answer

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

s = h * w / 2

if s % 2 == 0:
    t = int(s)
else:
    t = int (s + 1)

print (t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

h,w = miinps()
ans = 0
k = w%2
l = w//2
p = h//2
q = h%2

if h == 1:
  print(1)
  exit()
if k == 1:
  ans += (h*l)
  if q == 1:
    ans += (p+1)
  else:
    ans += p
else:
  ans += (h*l)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

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

x = (H//2)*W
y = (H%2)*math.ceil(W/2)

print(x+y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

N = [int(_) for _ in input().split()]

H, W = N[0], N[1]


def solve(H, W):
    cnt = 0
    
    for i in range(H):
        if i % 2 == 0:
            cnt += int(W / 2) + 1
        else:
            cnt += W - (int(W / 2) + 1)
            
    return cnt

print(solve(H, W))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
H, W = list(map(int,input().split()))
seki = H * W
if seki % 2 == 0:
    print(int(seki/2))
else:
    print(math.ceil(seki/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

h,w=mi()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = (w * h + 1) //2
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

Submission status: Wrong Answer

Solution code:

h, w = map(int, input().split())
print(-((-h * w) // 2))

Submission status: Wrong Answer

Solution code:
H,W=map(int,input().split())
import math
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:
i = input()
data = i.split(" ")
if (int(data[0])*int(data[1]))%2 == 0:
    print(int(data[0])*int(data[1])/2)
else:
    print(int(data[0])*int(data[1])//2+1)

Submission status: Wrong Answer

Solution code:
import math

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

ans = math.ceil(h * w / 2)

print(ans)

Submission status: Wrong Answer

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

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

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

allmas = h*w

if allmas % 2 == 1:
    print(int((allmas/2) + 0.5))
else:
    print(int(allmas/2))

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

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

h1 = math.ceil(H / 2)
w1 = math.ceil(W / 2)
h2 = math.floor(H / 2)
w2 = math.floor(W / 2)

print(h1*w1 + h2*w2)

Submission status: Wrong Answer

Solution code:
d = input().split(" ")
h = int(d[0])
w = int(d[1])
if h % 2 == 1 and w % 2 == 1:
	p = int(h * w / 2) + 1
else:
	p = int(h * w / 2)
print(p)

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)