Problem:


Score : 200 points

Problem Statement

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

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

r_1 + c_1 = r_2 + c_2

r_1 - c_1 = r_2 - c_2

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

Constraints

1 \leq H, W \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H \ W

Output

Print the number of squares the bishop can reach.

Sample Input 1

4 5

Sample Output 1

10

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

Sample Input 2

7 3

Sample Output 2

11

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

Sample Input 3

1000000000 1000000000

Sample Output 3

500000000000000000



Sample input:
4 5


Sample output:
10

Submission status: Runtime Error

Solution code:
from itertools import chain, permutations, dropwhile
from heapq import merge
from functools import wraps

def listify(fn):
  @wraps(fn)
  def wraper(*args, **kwargs):
    return list(fn(*args, **kwargs))
  return wraper

def comp_wild(a,b):
  return all(x==y or "?" in (x,y) for x,y in zip(a, b))

@listify
def includers(a,b):
  for i in range(len(a)-len(b)+1):
    if comp_wild(a[i:], b):
      yield i

@listify
def connectors(a,b):
  la = len(a)
  for i in range(max(la-len(b)+1, 1), la):
    if comp_wild(a[i-la:], b):
      yield i
  yield la

class c_int(int):
  def __new__(cls, *args, **kwargs):
    cond = kwargs.pop("cond", lambda:True)
    i = int.__new__(cls, *args, **kwargs)
    i.cond = cond
    return i

def iter_from(it, fm):
  return dropwhile(fm.__gt__, it)

def solve(a, b, c):
  keys = sorted((a,b,c), key=len, reverse=True)
  len_keys = list(map(len, keys))
  inc = { (i,j):includers(keys[i],keys[j]) for i,j in permutations(range(3), 2) }
  con = { (i,j):connectors(keys[i],keys[j]) for i,j in permutations(range(3), 2) }
  
  for i in inc[0,1]:
    for j in inc[0,2]:
      if (
        j+len_keys[2] <= i or i+len_keys[2] <= j or
        j-i in inc[1,2] or j-i in con[1,2] or i-j in con[2,1]
      ):
        return len_keys[0]
  
  def candicates(x,y,z):
    return chain(
      ( c_int(
          i+len_keys[z], 
          cond=lambda:(
            (inc[x,y] and inc[x,y][0]+len_keys[y] <= i) or 
            (inc[z,y] and len_keys[x] <= i+inc[z,y][-1]) or 
            any(
              (i-j in con[y,z] if i>j else j-i in inc[z,y])
               for j in iter_from(inc[x,y]+con[x,y], i-len_keys[y])
            )
          )
        ) for i in iter_from(con[x,z], len_keys[y]-len_keys[z]+1)
      ),
      ( c_int(
          min( i+next(iter_from(q, len_keys[x]-i+1))+len_keys[z] for i in p )
        ) for (p, q) in [sorted((con[x,y], con[y,z]), key=len)]
      ),
    )
  
  for c in merge(*( candicates(*xyz) for xyz in permutations(range(3), 3) )):
    if c.cond():
      return c
  
  return sum(len_keys)

print(solve(*(input() for _ in range(3))))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sequtils
from strutils import split, parseInt
from math import ceil

let
  HW = map(readLine(stdin).split(), parseInt)

if HW[0] == 1 or HW[1] == 1:
  echo 1
else:
  echo int(ceil(HW[0] * HW[1] / 2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
if(min(h,w)==1):
  	print(1)
     exit()
if(w%2==1):
    w1=(w//2)+1
    w2=w//2
else:
    w1=(w//2)
    w2=(w//2)+1
if(h%2==1):
    h1=(h//2)+1
    h2=(h//2)
else:
    h1=(h//2)
    h2=(h//2)+1

if(w%2==1 and h%2==1):
    ans=w1*h1+w2*h2
elif(w%2==1 and h%2==0):
    ans=w1*h1+w2*h1
elif(w%2==0 and h%2==1):
    ans=w1*h1+w2*h2
else:
    ans=w1*h1+w1*h1
print(ans)

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
if(min(h,w)==1):
  	print(1)
    exit()
if(w%2==1):
    w1=(w//2)+1
    w2=w//2
else:
    w1=(w//2)
    w2=(w//2)+1
if(h%2==1):
    h1=(h//2)+1
    h2=(h//2)
else:
    h1=(h//2)
    h2=(h//2)+1

if(w%2==1 and h%2==1):
    ans=w1*h1+w2*h2
elif(w%2==1 and h%2==0):
    ans=w1*h1+w2*h1
elif(w%2==0 and h%2==1):
    ans=w1*h1+w2*h2
else:
    ans=w1*h1+w1*h1
print(ans)

Submission status: Runtime Error

Solution code:
package main

import (
	"fmt"
)

func main() {
	var h, w int
	fmt.Scanf("%d %d", &h, &w)
	answer := countMovableCandidates(h, w)
	fmt.Println(answer)
}

func countMovableCandidates(h, w int) int {
	oddRows := h/2 + h%2
	evenRows := h / 2
	oddRowsMovableCell := w/2 + w%2
	evenRowsMovableCell := w / 2

	if h == 1 || w == 1 {
		return 1
	}

	return (oddRows * oddRowsMovableCell) + (evenRows * evenRowsMovableCell)
}

Submission status: Runtime Error

Solution code:
def scanf(scanstr,data_format):
    scanstr=scanstr.split(" ")
    if(type(data_format) is not list):
        print("data_format error")
    if(len(scanstr)!=len(data_format)):
        print("Error")
        return -1
    j=0
    for kata in data_format:
        if(kata=="str"):
            scanstr[j]=str(scanstr[j])
        if(kata="int"):
            scanstr[j]=int(scanstr[j])
        j=j+1
    return scanstr
data=mylib.scanf(input(),["int","int"])
if data[0]!=1 and data[1]!=1:
    print(str(round(float(data[0]*data[1])/2.0+0.1)))
else:
    print(1)

Submission status: Runtime Error

Solution code:
def scanf(scanstr,data_format):
    scanstr=scanstr.split(" ")
    if(type(data_format) is not list):
        print("data_format error")
    if(len(scanstr)!=len(data_format)):
        print("Error")
        return -1
    j=0
    for kata in data_format:
        if(kata=="str"):
            scanstr[j]=str(scanstr[j])
        if(kata=="int"):
            scanstr[j]=int(scanstr[j])
        j=j+1
    return scanstr
import mylib
data=mylib.scanf(input(),["int","int"])
if data[0]!=1 and data[1]!=1:
    print(str(round(float(data[0]*data[1])/2.0+0.1)))
else:
    print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(N)

Submission status: Runtime Error

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

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

print(N)

Submission status: Runtime Error

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


if H % 2 ==0:
    N = H * W / 2

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

print(N)

Submission status: Runtime Error

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


if H % 2 ==0:
    N = H * W / 2

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

print(N)

Submission status: Runtime Error

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


if H % 2 ==0:
    N = H * W / 2

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

print(N)

Submission status: Runtime Error

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


if H % 2 ==0:
    N = H * W / 2

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

print(N)

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())

if H % 2 ==0:
  N = H * W / 2

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

print(N)

Submission status: Runtime Error

Solution code:
H = int(input())
W = int(input())

if H % 2 ==0:
    N = H * W / 2

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

print(N)

Submission status: Runtime Error

Solution code:
H = input()
W = input()
H = int(H)
W = int(W)

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

Submission status: Runtime Error

Solution code:
H = input()
W = input()
H = int(H)
W = int(W)
if H % == 0:
	N = H * W / 2 
else:
  	N = int (H * W) / 2 + 1

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    ll h, w;
    cin >> h >> w;
    if (h == 1 || w == 1) {
        cout << 0 << endl;
        return 0;
    }
    if (h % 2 == 1 && w % 2 == 1) {
        cout << h * w / 2 + 1LL << endl;
    } else {
        cout << h * w / 2 << endl;
    }
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = list(map(int, input().split()))
x=l[0]*l[1]
if l[0]==1 or l[1]=1:
    print('1')
elif x%2==0:
    print(int(x/2))
else:
    print(int(x//2))

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np


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

H=a[0]
W=a[1]


table=np.zeros((H,W))
#0:未到達
#1:到達可能
#2:探索済み

r=0
c=0
table[r,c]=1

def fill_table(a,b,T):
    T[a,b]=2
    for w in range(T.shape[0]):
        for h in range(T.shape[1]):
            if(not((w+h == a+b)and(w-h == a-b))):
                if(w+h == a+b):
                    if(T[w,h]==0):
                        T[w,h]=1
                elif(w-h == a-b):
                    if(T[w,h]==0):
                        T[w,h]=1
    return T

while(True):
    rows=np.where(table==1)[0]#未到達の列番号
    colums=np.where(table==1)[1]#未到達の行番号
    if(len(rows) == len(colums) == 0 ):
        print(int(sum(sum(table))/2))
        break
    for i in range(len(rows)):
        table=fill_table(rows[i],colums[i],table)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np


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

H=a[0]
W=a[1]


table=np.zeros((H,W))
#0:未到達
#1:到達可能
#2:探索済み

r=0
c=0
table[r,c]=1

def fill_table(a,b,T):
    T[a,b]=2
    for w in range(T.shape[0]):
        for h in range(T.shape[1]):
            if(not((w+h == a+b)and(w-h == a-b))):
                if(w+h == a+b):
                    if(T[w,h]==0):
                        T[w,h]=1
                elif(w-h == a-b):
                    if(T[w,h]==0):
                        T[w,h]=1
    return T

while(True):
    rows=np.where(table==1)[0]#未到達の列番号
    colums=np.where(table==1)[1]#未到達の行番号
    if(len(rows) == len(colums) == 0 ):
        print(sum(sum(table))/2)
        break
    for i in range(len(rows)):
        table=fill_table(rows[i],colums[i],table)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import numpy as np

H=0
W=0
input(H)
input(W)

table=np.zeros((H,W))
#0:未到達
#1:到達可能
#2:探索済み

r=0
c=0
table[r,c]=0

def fill_table(a,b,T):
    T[a,b]=2
    for w in range(T.shape[0]):
        for h in range(T.shape[1]):
            if(w+h == a+b):
                if(T[w,h]==0):
                    T[w,h]=1
            elif(w-h == a-b):
                if(T[w,h]==0):
                    T[w,h]=1
    return T

while(True):
    rows=np.where(table==1)[0]#未到達の列
    colums=np.where(table==1)[1]#未到達の行
    if(len(rows) == len(colums) == 0 ):
        print(sum(sum(table)))
        break
    for row in rows:
        for colum in colums:
            table=fill_table(r,c,table)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

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

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

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

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

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

  print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H, W = [int(_) for _ in input().split()]
if H == 1 and W == 1:
    print(1)
elif H %2 == 0:
    print(int(H*W/2))
else:
    print(int((H-1)*W/2) + int(math.ceil(W/2)))

Submission status: Runtime Error

Solution code:
//In the name of ALLAH

#include<bits/stdc++.h>
using namespace std;
#define nn '\n'
#define pb push_back
#define F(i, n) for(int i = 0; i < n; ++i)
#define Fe(i, n) for(auto i: n)
#define  ll long long int



int main(){
	ll a, b; cin>>a>>b;
	ll sum = (a * b + 1) / 2;
	cout<<sum<<"\n";
	return 0;
	}

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

sum1 = (a * b) / 2

print(sum1)

Submission status: Runtime Error

Solution code:
num1, num2 = map(int, input())
ans = num1 * int(num2 / 2) + ((num2 % 2) * int(num1 / 2))
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  ll h, w;
  cin >> h >> w;
  ll ans;
  ans = (h * w + 1) / 2;

  if (h == 1 || w == 1) cout << 1 << endl;
  else cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
from math import ceil
h,w =map(int,input(),split())
ss = (h*(w+1)//2)
if h>1 and w>1:
  print(ss)
else:
  print(1)

Submission status: Runtime Error

Solution code:
from math import ceil
h,w =map(int,input(),split())
ss = (h*(w+1)//2)
if h>1 and w>1:
	print(ss)
else:
	print(1)

Submission status: Runtime Error

Solution code:
from math import ceil
h,w =map(int,input(),split())
ss = (h*(w+1)//2)
if h>1 and w>1:
	print(ss)
else:
  print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import ceil
h,w =map(int,input(),split())
ss = (ceil(h/2)*ceil(w/2))+(h//2*w//2)
if h>1 and w>1:
	print(ss)
else:
  print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from bisect import bisect_left, bisect_right
from typing import List
import collections
import bisect
import itertools
import functools
from fractions import gcd
import heapq
from math import ceil, sqrt, floor

import sys
sys.setrecursionlimit(50000)

import collections

from collections import defaultdict, deque
import collections

import bisect
import collections
from sortedcontainers import SortedList, SortedDict


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

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)

Submission status: Runtime Error

Solution code:
h, w = int(input().split())
r1 = 0
c1 = 0
count = 0
r2 for r2 in range(0,h-1):
  c2 for c2 in range(0,w-1):
    if r1 + c1 == r2 + c2 or r1 - c1 == r2 - c2:
      r1 = r2
      c1 = c2
      count += 1
print(count)

def main():
    H, W = map(int, input().split())
    if H == 1 or W == 1:
        print(1)
        return
    ans = ((H + 1)//2) * ((W + 1) //2)
    ans += (H//2) * (W//2)
    print(ans)
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:


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

areas = [ceil(H / 2), H // 2]

ret = areas[0] * (ceil(W / 2)) + areas[1] * (W // 2)

print(ret)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# コーナーケースに注意！1行 or 1列の時は動けないよ！
if H == 1 or W == 1:
    print(1)
    return

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

print(int(ans))

Submission status: Runtime Error

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

if (H==1 or W==1):
	totalSum = 1
else:
	totalsum = (W * H) // 2
	totalsum += (W * H) % 2

print(totalsum)

Submission status: Runtime Error

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

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(totalsum)

Submission status: Runtime Error

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

if (H==1 or W==1):
	totalSum = 1
else:
	totalsum = (W * H) // 2
	totalsum += (W * H) % 2

print(totalsum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import math
row = int(sys.argv[1])
column = int(sys.argv[2])

result = 0

if row == 1 or column == 1 :
    result = 1
else:
    result = math.ceil((row * column) / 2)

print(result)

Submission status: Runtime Error

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

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


def solve(H, W):
    acnt = floor(W / 2) + 1
    bcnt = W - acnt
    
    if H == 1 or W == 1:
        return 1
    
    if H % 2 == 0:
        cnt = acnt * floor(H/2) + bcnt * floor(H/2)
    else:
        cnt = acnt * (floor(H/2) + 1) + bcnt * floor(H/2)
    return cnt

print(solve(H, W))

Submission status: Runtime Error

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

unsigned long long H;
unsigned long long W;

void input() {
    cin >> H;
    cin >> W;
}

int main() {
    input();

    if(H == 1 || W == 1){
        cout << 1 << endl;
    } else {
        cout << (H * W + 1) / 2 << endl;
    }
    return 0;
}

Submission status: Runtime Error

Solution code:
if W % 2 == 0:
    print((H * W) // 2)
elif H == 1 or W == 1:
    print(1)
else :
    odd_row = (W // 2) + 1
    print('odd_row',odd_row)
    even_row = W // 2
    if H % 2 == 1:
        odd_row_num = (H // 2) + 1
        even_row_num = H // 2
        print((odd_row*odd_row_num) + (even_row*even_row_num))
    else :
        print((odd_row+even_row) * (H // 2))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math


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

if n[0] % 2 == 0:
  print(math.ceil(n[0] / 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
  
  elif n[0] == 1 or n[1] == 1:
    print('1')
else:
  result = math.ceil(n[0] / 2) * math.ceil(n[1] / 2) + math.floor(n[0] / 2) *math.floor(n[1] / 2)
  print(result)

Submission status: Runtime Error

Solution code:
import math


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

if n[0] % 2 == 0:
  print(math.ceil(n[0] / 2 * n[1]))
  
elif n[1] % 2 ==0:
  print(math.ceil(n[1]/ 2 * n[0]))
  
  elif n[0] == 1 or n[1] == 1
else:
  result = math.ceil(n[0] / 2) * math.ceil(n[1] / 2) + math.floor(n[0] / 2) *math.floor(n[1] / 2)
  print(result)

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(void)
{
	unsigned long long a,b,c;
	
	scanf("%llu %llu", &a,&b);
	
	c = a*(b/2);
	if(b%2==1){
		if(a%2==0){
			c = c + (a/2);
		}else{
			c = c + (a/2)+1;
		}
		
	}
	
	if(a== 1 || b==1)c=1;
	
	printf("%llu\n", c);
	
	return 0;
}

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

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

print(ans)

Submission status: Runtime Error

Solution code:
a,b,c = int(input().split())
if c**(1/2) > (a**(1/2)+b**(1/2)):
	print("Yes")
else:
	print("NO")

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

H, W = read_int()

def solve():
    if H == 1:
        return W
    elif W == 1:
        return H
    else:
        return ans = W * H // 2 + W * H % 2

if __name__ == "__main__":
    print(solve())

Submission status: Runtime Error

Solution code:
a,b,c = input().split()
if c**(1/2) > (a**(1/2)+b**(1/2)):
    print("Yes")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
num1 = (a//2)*(b//2)

if a == 1 :
    print(b)
else if b==1:
  	print(a)
else:
    
    # print(num1)
    p = b//2
    q = a//2
    num2 = (b - p )*(a - q)
    ans = num1+num2
    print(num1+num2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from decimal import Decimal

h, w = input().split()
h_d = Decimal(h)
w_d = Decimal(w)
d_05 = Decimal('0.5')

if int(h) % 2 == 0:
    print(int(h_d*w_d*d_05))
else:
    if int(w) % 2 == 0:
        c = h_d * w * d_05
    else:
        c = d_05 * (h_d * w_d + Decimal('1'))
    print(int(c))

Submission status: Runtime Error

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(x==1 or y==1):
  print(1)
  return
if((x*y)%2==1):
  print(int(input_num/2)+1)
else:
  print(int(input_num/2))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cmath>
using namespace std;

int main(void){
  long long int a, b;
  cin >> a >> b;
  if(a % 2 == 1 && b % 2 == 1){
    cout << (long long int)((long long int)(b*a)/(long long int)2 + 1) << endl;
  }
  else{
    cout << (long long int)((long long int)(b*a)/(long long int)2) << endl;
  }
  
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

int main()
{
  int64_t H, W;
  cin >> H >> W;
  int64_t ans = H * W / 2;
  if ((H * W) % 2)
  {
    ans++;
  }
  cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
    a,b,c = line.split()
    if c**(1/2) > (a**(1/2)+b**(1/2)):
        print("Yes")
    else:
        print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    a,b,c = line.split()
    if c**(1/2) > (a**(1/2)+b**(1/2)):
  		print("Yes")
	else:
  		print("No")

Submission status: Runtime Error

Solution code:
H = input()
W = input()
mas = int(H)*int(W)
h = mas%2

if h==0:
    print(int(mas/2))
else:
    print(int((mas+1)/2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
H = input()
W = input()
mas = int(H)*int(W)
h = mas%2

if h==0:
    print(mas/2)
else:
    print((mas+1)/2)

Submission status: Runtime Error

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

Solution code:
import math

a = int(input())
b = int(input())

print(math.ceil(a*b/2))

Submission status: Runtime Error

Solution code:
h,w = map(int,input().split())
h_a = h % 2
w_a = w % 2
h_b = h // 2 
w_b = w // 2 
if(h == 1 || w == 1):
  print(1)

elif((h_a == 0) & (w_a == 0)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 0)):
  print(w_b * h)
elif((h_a == 0) & (w_a == 1)):
  print(h_b * w)
elif((h_a == 1) & (w_a == 1)):
  print((h_b + 1) * (w_b + 1) + h_b * w_b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import ceil
a,b =map(int,input(),split())
ss = (ceil(a/2)*ceil(b/2))+(a//2*b//2)
if a>1 and b>1:
	print(ss)
else:
  print(1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import ceil
a,b =map(int,input(),split())
ss = (ceil(a/2)*ceil(b/2))+(a//2*b//2)
if a>1 and b>1:
	print(ss-hf)
else:
  print(1)

Submission status: Runtime Error

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


void solve(long long H, long long W){
    if(H==1 || W==1){
        cout << 1 << endl;
        return;
    }
    long long HW = H*W;
    long long ans = HW/2LL + HW%2LL;
   
    cout << ans << endl;


}

// 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)
int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    solve(H, W);
    return 0;
}

Submission status: Runtime Error

Solution code:
from math import ceil
a,b =map(int,input(),split())
ss = ceil(a/2)*ceil(b/2)+a//2*b//2
if a>1 and b>1:
	print(ss-hf)
else:
  print(1)

Submission status: Runtime Error

Solution code:
from math import sqrt
a, b, c = map(int, input().split())
if a + 2*sqrt(a)*sqrt(b) + b < c:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import math 
a=input().split(' ')
a=[int(x) for x in a]
t1=math.sqrt(a[0])+math.sqrt(a[1])
t2=math.sqrt(a[2])
if t1<t2:
    print("Yes")
else:
    print("No")