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:
n = list(map(int,input().split()))
print(int(n[0]*n[1]//2+1))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    #→1,.→0として読み込む
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '#' else 0 for s in read()[:-1]])
        # 内包表記はpypyでは若干遅いことに注意
        # #numpy使うだろうからこれを残しておくけど
    return ret


# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from fractions import gcd


def lcm(a, b):
    # 最小公約数
    g = gcd(a, b)
    return a * b // g


H, W = read_ints()

# 市松模様を分解してカンガル
# Hはそのまま詰める
# print((H * (W // 2)) + (W % 2) * ((H + 1) // 2))
# print((H * (W // 2)), (W % 2) * ((H + 1) // 2))

# print()

# #.#.#
# .#.#.
# #.#.#
# .#.#.
# #.#.#

# # 一回すなおに実装してみる
# ans = 0
# ans += H * (W // 2)
# # Wが奇数の場合
# if W % 2 == 1:
#     ans += (H + 1) // 2
# print(ans)

ans = 0
ans += W * (H // 2)
# Hが奇数の場合
if H % 2 == 1:
    ans += (W + 1) // 2
print(ans)

Submission status: Wrong Answer

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

print(number)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
input_line = input()
lines = input_line.split()
x=int(lines[0])
y=int(lines[1])
input_num=x*y
if(input_num%2==1):
  print(int(input_num/2)+int(1))
else:
  print(int(input_num/2))

Submission status: Wrong Answer

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

    if H == 1:
        print(1)
        return

    count = H * W
    ans = count // 2

    if count % 2 != 0:
        ans += 1

    print(ans)

resolve()

Submission status: Wrong Answer

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-


def count(H, W):
    if W % 2 == 0:
        return int(H * int(W / 2))
    else:
        w2 = int(W / 2)
        w1 = w2 + 1
        
        if H % 2 == 0:
            return int((w1 + w2) * int(H / 2))
        else:
            return int((w1 + w2) * int(H / 2) + w1)


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

    print(count(H, W))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    if H==1 and W ==1 :
        print(0)
        return 
    dd= W*(H//2)

    if H%2==1:
        dd += math.ceil(W/2)
    print(1 if H==1 or W==1 else dd) 
    


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(map(int,input().split()))
print(int(n[0]*n[1]/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+1)*W)//2-(W-1)//2))

Submission status: Wrong Answer

Solution code:

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


h = 0
w = 0
w1 = w2 = 0

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


elif W % 2 == 1:#横が奇数
    w = int(W /2) + 1
    if H % 2 == 1:#縦が奇数
        h = int(H / 2) + 1
        w1 = h * w
        w2 = (w-1) * (h-1)
        print(w1 + w2)
    else:#縦が偶数
        h = int(H / 2)
        w1 = w * h
        w2 = (w-1) * h
        print(w1 + w2)
        
        
else:#横が偶数
    w = int(W / 2)
    print(w * H)

Submission status: Wrong Answer

Solution code:

import glob


# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\159\\B'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            self.index += 1
            return self.problem[self.index-1]

        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        except NameError:
            self.resolve()


class Solver(Common):

    def resolve(self):

        tmp = [int(i) for i in self.input_data().split()]
        H = tmp[0]
        W = tmp[1]

        count = int(H * W / 2)

        if H % 2 == 1 and W % 2 == 1:
            count += 1

        print(str(count))


solver = Solver(REL_PATH)
solver.exec_resolve()

Submission status: Wrong Answer

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

hantei = h % 2
hantei_2 = w % 2

if hantei == 0:
    h = math.floor(h)
    result = (sum - (h / 2) * w)
    print(math.floor(result))

else:
    if hantei_2 == 0:
        h = h + 1 
        print(math.floor(sum - h * 2))
    else:
        w = w /2 
        w = math.floor(w)
        kake =  w + 1
        h = h /2 
        h = math.floor(h)
        result = sum - ((kake * h) +  ((kake -1 ) *(h + 1)))
        print(math.floor(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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


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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if int(H) == 0 and int(W) == 0:
    count = 1
else:
    count = int(H) * int(W) / 2
print(math.ceil(count))

Submission status: Wrong Answer

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

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


print(a)

Submission status: Wrong Answer

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

if a==1 and b==1:
	print(1)
elif a*b%2 == 0:
	print(int(a*b/2))
elif a*b%2 == 1:
	print(int(math.floor(a*b/2+1)))

Submission status: Wrong Answer

Solution code:
from decimal import *
getcontext().prec = 20

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

a = Decimal( -(-H * W // 2))
print(a)

Submission status: Wrong Answer

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

N1 = min(H, W)
N2 = max(H, W)

if N1 % 2 == 0:
  count = (N1 * N2) // 2
else:
  count = (N1 * (N1 -1) + N1 + 1) // 2
  if (N2 - N1) % 2 == 0:
    count += (N1 * (N2 - N1)) // 2
  else:
    count += (N1 * (N2 - N1 - 1) + N1 - 1) // 2

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = list(map(np.int64, input().split()))
print((N[0]*N[1]+1)//2)

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
from decimal import *
s = input().split()
t = [int(p) for p in s]


#print(t)
if( Decimal(Decimal(t[0]) % 2 )== 1 and Decimal(Decimal(t[1]) % 2) == 1):
    n = Decimal( Decimal(Decimal(t[0]) - 1) // 2  )
    #print(n)
    m = Decimal( Decimal(Decimal(t[1]) - 1) // 2  )
    answer = Decimal(    Decimal(  Decimal(Decimal(m) + 1)     *    Decimal(Decimal(n) + 1)  )   + Decimal( Decimal(m) * Decimal(n) )       )
else:
    answer = Decimal(   Decimal(Decimal(t[0]) * Decimal(t[1])) // 2  )

print(int(answer))

'''
H = t[0]
W = t[1]
ans = 0
if( W % 2 == 0):
    for i in range(H):
        ans += W / 2
else:
    for i in range(H):
        if(i % 2 == 0):
            ans += W / 2.0 + 0.5
        else:
            ans += W / 2.0 - 0.5
print(int(ans))
'''

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

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7


import decimal
h = decimal.Decimal(H)
w = decimal.Decimal(W)

a = ((h+1)//2) * ((w+1)//2)
b = (h//2) * (w//2)

print(a+b)

Submission status: Wrong Answer

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

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


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

print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H = i[0]
W = i[1]


if(H == 1):
    if(W % 2 == 0):
        yoko = W // 2
    else:
        yoko = W // 2 + 1
    print(yoko)
elif(W == 1):
    print(1)
#横が偶数の時は、縦の偶奇によらない
elif(W % 2 == 0):
    yoko = W // 2
    print(yoko*H)
#横が奇数の時は、縦の偶奇による
elif(W % 2 != 0):
    yoko = W // 2 + 1
    #縦が偶数の時
    if(H % 2 == 0):
        print(yoko*(H//2)+(yoko-1)*(H//2))
    #縦が奇数の時
    else:
        print(yoko*(H//2+1)+(yoko-1)*(H//2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if h == 1:
    ans = 1
    
print(int(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
H,W = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7


import decimal
h = decimal.Decimal(H)
w = decimal.Decimal(W)

a = ((h+1)//2) * ((w+1)//2)
b = (h//2) * (w//2)

print(int(a+b))

Submission status: Wrong Answer

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

sum = h * w
sum = math.floor(sum)
#縦hマス横wマス
hantei = h % 2
hantei_2 = w % 2
#縦が偶数の時
if hantei == 0:
    h = math.floor(h)
    result = (sum - (h / 2) * w)
    print(math.floor(result))
#縦が奇数の時
else:
    #横が偶数の時
    if hantei_2 == 0:
        h = h + 1 
        h = math.floor(h)
        print(math.floor(sum - h * 2))
    #横が奇数の場合
    else:
        w = w /2 
        w = math.floor(w)
        kake =  w + 1
        h = h /2 
        h = math.floor(h)
        result = sum - ((kake * h) +  ((kake -1 ) *(h + 1)))
        print(math.floor(result))

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())


H,W=acinput()


if H<W:
    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=int(H/2)*W
    mod=0
else:
    tmp = np.floor(W)
    mod = int(H % 2)
    res = int(H*tmp)+np.floor(H//2)
   
    #print(res,mod,int(res)+int(mod))
    
    

if mod==1:
    print(int(res)+mod)
else:
    print(int(res))


#999999999 999999999

Submission status: Wrong Answer

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

if w%2 == 0:
    a = w//2
    b = w//2
else:
    a = w//2 + 1
    b = w//2

if h%2 == 0:
    c = h//2
    d = h//2
else:
    c = h//2 + 1
    d = h//2

print(a*c + b*d)

Submission status: Wrong Answer

Solution code:
#B - Bishop
import math
H,W= map(int, input().split())
print(int(math.ceil(H/2) * math.ceil(W/2) + math.floor(H/2)*math.floor(W/2)))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from math import ceil

H, W = map(int, input().split())
print(ceil(H * W / 2.0))

Submission status: Wrong Answer

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

if ((h * w) > 10 ** 18):
    a1 = 0
elif(((h * w) % 2) == 1):
    a1 = ((h * w) // 2) + 1
elif(((h * w) % 2) == 0):
    a1 = (h * w) // 2


print(a1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


h = 0
w = 0
w1 = w2 = 0
if W % 2 == 1:#横が奇数
    w = int(W /2) + 1
    if H % 2 == 1:#縦が奇数
        h = int(H / 2) + 1
        w1 = h * w
        w2 = (w-1) * (h-1)
        print(w1 + w2)
    else:#縦が偶数
        h = int(H / 2)
        w1 = w * h
        w2 = (w-1) * h
        print(w1 + w2)
        
        
else:#横が偶数
    w = int(W / 2)
    print(w * H)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal

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

a = Decimal(H * W + 1)
print(a // Decimal(2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b = (int(x) for x in input().split())
if a > b:#b対象
    anb1 = b * b 
    anb2 = ((a-b) * b)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
            
elif a < b:#a対象            
    anb1 = a * a 
    anb2 = ((b-a) * a)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(int(a / 2) * a)
    else:
        print(int((a * a) / 2) + 1)

Submission status: Wrong Answer

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

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

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())


H,W=acinput()


if H<W:
    H,W=W,H

H = float(H)
W = float(W)


if W%2==0:
    res=int(H/2)*W
    mod=0
else:
    tmp = np.floor(W)
    mod = int(H % 2)
    res = int(H*tmp)+np.floor(H//2)
   
    #print(res,mod,int(res)+int(mod))
    
    

if mod==1:
    print(int(res)+1)
else:
    print(int(res))


#999999999 999999999

Submission status: Wrong Answer

Solution code:
import numpy as np
def main(w,h):
    if np.mod(w*h, 2) != 0:
        return int(((w*h)+1)/2)
    else:
        return int((w*h)/2)

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

Submission status: Wrong Answer

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

H = i[0]
W = i[1]


if(H == 1):
    if(W % 2 == 0):
        yoko = W // 2
    else:
        yoko = W // 2 + 1
    print(yoko)
#横が偶数の時は、縦の偶奇によらない
elif(W % 2 == 0):
    yoko = W // 2
    print(yoko*H)
#横が奇数の時は、縦の偶奇による
elif(W % 2 != 0):
    yoko = W // 2 + 1
    #縦が偶数の時
    if(H % 2 == 0):
        print(yoko*(H//2)+(yoko-1)*(H//2))
    #縦が奇数の時
    else:
        print(yoko*(H//2+1)+(yoko-1)*(H//2))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from decimal import *
H,W=map(int,input().split())
kisuu = (H // 2) + (H % 2)
gusu = (H // 2)
if W%2 == 1:
	print(kisuu * (W // 2 + 1) + gusu *(W // 2))
else:
	print(kisuu * (W / 2) + gusu * (W / 2))

Submission status: Wrong Answer

Solution code:
a,b = (int(x) for x in input().split())
if a > b:#b対象
    anb1 = b * b 
    anb2 = ((a-b) * b)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
            
elif a < b:#a対象            
    anb1 = a * a 
    anb2 = ((b-a) * a)
    if (anb1 % 2) == 0:#偶数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2) + int(anb2/2))
        else:#奇数
            print(int(anb1/2) + int(anb2/2))
    else:#奇数
        if  anb2 % 2 == 0:#anb2 偶数
            print(int(anb1/2 + 1) + int(anb2/2))
        else:#奇数
            print(int(anb1/2 + 1) + int(anb2/2))
elif a == b:
    if a % 2 == 0:
        print(int(a / 2) * a)
    else:
        print(int(a * a / 2) + 1)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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

    if H==1 and W ==1 :
        print(0)
        return 
    dd= W*(H//2)

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import ceil

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


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

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 = [int(x) for x in input().split()]

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

Submission status: Wrong Answer

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

wrk = (h//2) * -(-w//2) + (h//2) * (w//2)

if h%2 == 1:
    wrk+=-(-w//2) 

print(wrk)

Submission status: Wrong Answer

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

main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 0
for h in range(H):
    count += W // 2
    if h % 2 == 0 and W % 2 != 0:
        count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
h, w = [int(s) for s in input().split()]
rh, rw = h%2, w%2
eh, ew = h - rh, w- rw

result = int( eh * ew //2)
if rh == 1:
    result += ew //2
if rw == 1:
    result += eh //2
if rh == rw == 1:
    result += 1

print(result)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
def input(): return sys.stdin.readline().rstrip()
H, W = map(int, input().split())

#odd
odd_row = int(math.ceil(W/2))
#even
even_row = int(W/2)

print(odd_row*int(math.ceil(H/2)) + even_row*(int(H/2)))

Submission status: Wrong Answer

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

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

print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if h % 2 == 1 and w % 2 == 1:
   check = 1
else:
   check = 0


sh = len(str(h)) - 1
h = float(h / 10**sh)

sw = len(str(w)) - 1
w = float(w / 10**sw)

ans = int(h*w*10**(sh+sw)//2)

if check == 1:
   print(ans+1)
else:
   print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
import sys
n = list(map(int, input().split()))

if n[0] == 1 or n[1] == 1:
    print(0)
    sys.exit()

if n[0] % 2 == 0:
    print(Decimal(int((n[0]/2)*n[1])))
    sys.exit()
else:
    if n[1] % 2 == 0:
        print(Decimal(int(n[0]*(n[1]/2))))
        sys.exit()
    else:
        a = ((n[0]-1)*n[1])/2
        b = n[1] - int(n[1]/2)
        print(Decimal(int(a+b)))
        sys.exit()

Submission status: Wrong Answer

Solution code:
from decimal import Decimal, ROUND_UP

H, W = map(Decimal, input().split())
HW = H*W
res = H*W/Decimal(2)
print(res.quantize(Decimal('0'), rounding=ROUND_UP))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

row1 = w//2 + w%2
row2 = w//2

total = (row1 * (h//2+h%2)) + (row2 * (h//2))

print(total)

Submission status: Wrong Answer

Solution code:
import math

a, b = map(int, input().split())
x = a*b
print(math.ceil(x/2))

Submission status: Wrong Answer

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

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


print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
x,y = map(float,input().split())
print('{:.0f}'.format((x*y+1)/2))

Submission status: Wrong Answer

Solution code:
from decimal import *
H,W=map(int,input().split())
kisuu = (H // 2) + (H % 2)
gusu = (H // 2)
if W%2 == 1:
	print(Decimal(kisuu) * Decimal((W // 2 + 1)) + Decimal(gusu) * Decimal((W // 2)))
else:
	print(Decimal(kisuu) * Decimal((W / 2)) + Decimal(gusu) * Decimal((W / 2)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
h, w = map(int, input().split())
first_row = math.ceil(w/2)
second_row = int(w/2)
ans = first_row * math.ceil(h / 2) + second_row * (h//2)
 
print(ans)

Submission status: Wrong Answer

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

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

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

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:
n, m = (int(x) for x in input().split())
if n % 2 == 0:
  ans = n * m // 2
else:
  if m % 2 == 0:
    ans = n * m // 2
  else:
    k = m + 1
    ans = n * k // 2- n // 2
print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import *
H,W=map(int,input().split())
kisuu = H // 2 + H % 2
gusu = H // 2
if W%2 == 1:
	print(Decimal(kisuu) * Decimal((W // 2 + 1)) + Decimal(gusu) * Decimal((W // 2)))
else:
	print(Decimal(kisuu) * Decimal((W / 2)) + Decimal(gusu) * Decimal((W / 2)))