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

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> pair_t;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = 1 << 29;
/****** define constant end ********/
/*
void saiki(ll kaisuu, ll n, string moji)
{
    kaisuu++;
    if (kaisuu == n)
    {
        cout << moji;
    }
    string l_c = moji.substr(moji.size() - 1, 1);
    string moji_st = moji + l_c;
    saiki(kaisuu, n, moji_st);
    int o = 1;
    char l_c_char = l_c.c_str();
    char pl = l_c_char[0] + o;
    string pl_s = ctos(pl);
    string moji_pl = moji + pl;
    saiki(kaisuu, n, moji_pl);
}
*/

/****** define variable start ******/
ll h, w;
/******* define variable end *******/
ll solve()
{
    /*
    cin >> n;
    string first("a");
    saiki(0, n, first);
    */
    cin >> h >> w;
    if (h % 2 == 0)
    {
        ll h2 = h / 2;
        cout << h2 * w << endl;
    }
    else if (w % 2 == 0)
    {
        ll w2 = w / 2;
        cout << h * w2 << endl;
    }
    else
    {
        ll h2 = (h - 1) / 2;
        ll anstmp = h2 * w + h;
        cout << anstmp << endl;
    }
    return 0;
}
int main()
{
    //clock_t start = clock();
    cout << std::fixed << std::setprecision(10);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll end_solve = solve();
    /*
    clock_t end = clock();
    const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;
    printf("time %lf[ms]\n", time);
    */

    return (int)end_solve;
}