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:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

H,W = imn()

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

Submission status: Wrong Answer

Solution code:

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

if H % 2 == 0:
    t = H // 2
    u = H // 2
else:
    t = H // 2 + 1
    u = H // 2

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

Submission status: Wrong Answer

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): #startline--------------------------------------------
    h,w = map(int,input().split())
    print(h*w // 2 if h % 2 == 0 or w % 2 == 0 else h*w // 2 + 1)
if __name__ == "__main__":
    main() #endline===============================================

Submission status: Wrong Answer

Solution code:
# N = int(input())
# A = list(map(int, input().split()))
H, W = map(int, input().split())

print(-(-(H * W) // 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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


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

Submission status: Wrong Answer

Solution code:
H,W = map(int,input().split())
h,w = H//2, W//2
h1, w1 = h, w
if H & 1:
    h += 1

if W & 1:
    w += 1

print(w * h + w1 * h1)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    h, w = list(map(int, input().strip().split()))
    print((h * w + 1) // 2)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
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:
    print (H * W // 2)
else:
    tmp = ((H + 1) // 2) * ((W + 1) // 2)
    tmp += ((H) // 2) * (W // 2)
    print (tmp)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
from collections import deque
def main():
    
    h,w = tuple([int(t)for t in input().split()])

    t = h*w//2+(h*w)%2
    print(t)


if __name__ == "__main__":
    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:
# from fractions import gcd
# from datetime import date, timedelta
# from heapq import *
# import heapq
# import math
# from collections import defaultdict, Counter, deque
# from bisect import *
# import itertools
# import fractions
# # import sys
# sys.setrecursionlimit(10 ** 7)
# MOD = 10 ** 9 + 7
# input = sys.stdin.readline


# def lcm(a, b):
#     return a * b / fractions.gcd(a, b)


# def make_divisors(n):
#     divisors = []
#     for i in range(1, int(n**0.5)+1):
#         if n % i == 0:
#             divisors.append(i)
#             if i != n // i:
#                 divisors.append(n//i)

#     # divisors.sort()
#     return divisors


# def factorize(n):
#     fct = []  # prime factor
#     b, e = 2, 0  # base, exponent
#     while b * b <= n:
#         while n % b == 0:
#             n = n // b
#             e = e + 1
#         if e > 0:
#             fct.append((b, e))
#         b, e = b + 1, 0
#     if n > 1:
#         fct.append((n, 1))
#     return fct


# def is_prime(n):
#     if n == 1:
#         return False

#     for k in range(2, int(math.sqrt(n)) + 1):
#         if n % k == 0:
#             return False

#     return True


# def primes(n):
#     is_prime = [True] * (n + 1)
#     is_prime[0] = False
#     is_prime[1] = False
#     for i in range(2, int(n**0.5) + 1):
#         if not is_prime[i]:
#             continue
#         for j in range(i * 2, n + 1, i):
#             is_prime[j] = False
#     return [i for i in range(n + 1) if is_prime[i]]

# def modpow(a, n, mod):
#     res = 1
#     while n > 0:
#         if n & 1:
#             res = res * a % mod
#         a = a * a % mod
#         n >>= 1
#     return res


# def modinv(a, mod):
#     return modpow(a, mod - 2, mod)


# def cnk(a, b):
#     MOD = 10**9+7
#     ret = 1
#     for i in range(b):
#         ret *= (a-i)
#         ret %= MOD
#         ret = ret * modinv(i+1, MOD) % MOD
#     return ret


# class UnionFind:
#     def __init__(self, n):
#         self.sz = [-1 for i in range(n)]

#     # 検索
#     def find(self, x):
#         if self.sz[x] < 0:
#             return x
#         else:
#             self.sz[x] = self.find(self.sz[x])
#             return self.sz[x]

#     # 併合
#     def union(self, x, y):
#         x = self.find(x)
#         y = self.find(y)
#         if x == y:
#             return False
#         if self.sz[x] > self.sz[y]:
#             x, y = y, x
#         self.sz[x] += self.sz[y]
#         self.sz[y] = x

#     # 同じ集合に属するか判定
#     def same(self, x, y):
#         return self.find(x) == self.find(y)

#     # xが含まれている集合のサイズを求める
#     def size(self, x):
#         return -self.sz[self.find(x)]

# class WeightedUnionFind:
#     def __init__(self, n):
#         self.par = [i for i in range(n+1)]
#         self.rank = [0] * (n+1)
#         # 根への距離を管理
#         self.weight = [0] * (n+1)

#     # 検索
#     def find(self, x):
#         if self.par[x] == x:
#             return x
#         else:
#             y = self.find(self.par[x])
#             # 親への重みを追加しながら根まで走査
#             self.weight[x] += self.weight[self.par[x]]
#             self.par[x] = y
#             return y

#     # 併合
#     def union(self, x, y, w):
#         rx = self.find(x)
#         ry = self.find(y)
#         # xの木の高さ < yの木の高さ
#         if self.rank[rx] < self.rank[ry]:
#             self.par[rx] = ry
#             self.weight[rx] = w - self.weight[x] + self.weight[y]
#         # xの木の高さ ≧ yの木の高さ
#         else:
#             self.par[ry] = rx
#             self.weight[ry] = -w - self.weight[y] + self.weight[x]
#             # 木の高さが同じだった場合の処理
#             if self.rank[rx] == self.rank[ry]:
#                 self.rank[rx] += 1

#     # 同じ集合に属するか
#     def same(self, x, y):
#         return self.find(x) == self.find(y)

#     # xからyへのコスト
#     def diff(self, x, y):
#         return self.weight[x] - self.weight[y]


class manacher:

    def __init__(self, l):
        self.n = len(l)
        self.m = 2*self.n+1
        self.d = ['&']*self.m
        self.r = [0]*self.m
        for i in range(self.n):
            self.d[2*i+1] = l[i]
        self.make_r()

    def make_r(self):
        i, j = 0, 0
        while i < self.m:
            while j <= i < self.m-j and self.d[i-j] == self.d[i+j]:
                j += 1
            self.r[i] = j
            k = 1
            while k <= i < self.m-k and k+self.r[i-k] < j:
                self.r[i+k] = self.r[i-k]
                k += 1
            i += k
            j -= k

    def judge(self, start, end):
        center = start+end
        return 2 * end - 1 < center + self.r[center]
        
def main():
    h, w = map(int, input().split())
    ans = h * w
    if ans % 2 == 0:
        print(ans//2)
    else:
        print(ans//2+1)
        
  


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if h == 1 and w == 1:
    print(1)
else:
    import math
    h_odds = math.ceil(h / 2)
    h_evens = h // 2
    w_odds = math.ceil(w / 2)
    w_evens = w // 2
    print(h_odds * w_evens + h_evens * w_odds)

Submission status: Wrong Answer

Solution code:
from sys import stdin,setrecursionlimit
import math
setrecursionlimit(10**7)
h,w = map(int,stdin.readline().rstrip().split())
print(math.ceil(h*w/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
R, C = map(int, input().split())

first = C // 2 if C % 2 == 0 else C // 2 + 1
second = C - first

if R % 2 == 0:
  print(C * (R // 2))
else:
  print(C * (R // 2) + first)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

#整数値龍力　複数の入力
def input_multiple_number():
    return map(int, input().split())

h,w = input_multiple_number()


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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	H,W = inputMap()

	ans = H*W

	print(-(-ans // 2))


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# special thanks :
#  https://nagiss.hateblo.jp/entry/2019/07/01/185421
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
from itertools import accumulate, groupby
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
# from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction
mod = int(pow(10, 9)+7)


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


def si(): return str(input())


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


def li(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]


def isPowerOfTwo(x): return (x and (not (x & (x - 1))))


def decimalToBinary(n): return bin(n).replace("0b", "")


def ntl(n): return [int(i) for i in str(n)]


def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


def dfs(d, v):
    q = []
    q.insert(0, v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.insert(0, i)
        print(x)


n, m = mi()
print(int(ceil(n*m/2)))

Submission status: Wrong Answer

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    h, w = list(map(int,ipti().split()))
    ans = 0
    ans += ((w+1)//2)*((h+1)//2)
    ans += (w//2)*(h//2)

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ans = 0
flag = True

oneloop = w

rest = (w-w//2)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

h,w = list(map(int, stdin.readline().rstrip().split()))
print(ceil((h*w)/2))

Submission status: Wrong Answer

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

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:
import sys
from math import ceil, floor
h, w  =[int(i) for i in sys.stdin.readline().split()]
print(ceil(h / 2) * ceil(w / 2) + (h - ceil(h / 2)) * (w - ceil(w / 2)))

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

Solution code:

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

print( - (-n*m//2)  )

Submission status: Wrong Answer

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

if H%2==0 or 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())
odds = h // 2
ow = w // 2
evens = odds + h % 2
ew = ow + w % 2
print(odds * ow + evens * ew)

Submission status: Wrong Answer

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

q,r = divmod(H*W, 2)
print(q+r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def div_ceil(x, y): return (x + y - 1) // y

H, W = map(int, input().split())
ans = div_ceil(W, 2) * div_ceil(H, 2) + (W // 2) * (H // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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


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

Submission status: Wrong Answer

Solution code:
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    H, W = list(map(int, sys.stdin.readline().split()))
    print(((H * W) + 1) // 2)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

result = h*w // 2 + h*w % 2
print(result)

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)

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
h,w=map(int,input().split())
ans=((h+1)//2+h//2)*(w//2)
if w%2==1:
  ans+=(h+1)//2
print(ans)

Submission status: Wrong Answer

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

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

if __name__ == '__main__':
    resolve()

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

print(h*w//2)

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [input().split() for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    h,w=map(int,input().split())
    print((h*w+2-1)//2)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "YES"
no = "NO"




def main():
    a,b = mi()
    ans = 0
    ans+=((a+1)//2)*((b+1)//2)
    ans+=(a//2)*(b//2)
    print(ans)

        
    


main()

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:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

h,w=mii()

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

Submission status: Wrong Answer

Solution code:
from math import *

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

print(ceil(h * w / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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