-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDomino Piling.cpp
38 lines (33 loc) · 913 Bytes
/
Domino Piling.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// https://codeforces.com/problemset/problem/50/A
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ll long long
#define pll pair<long, long>
#define vll vector<long long>
#define inf 1e18
#define range(a,b) substr(a,b-a+1)
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
int main()
{
FIO;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ll m, n;
cin >> m >> n;
if (m % 2 == 0)
cout << (m / 2) * n;
else if (n % 2 == 0)
cout << (n / 2) * m;
else
if (m > n)
cout << (m / 2) * n + (n / 2);
else
cout << (n / 2) * m + (m / 2);
return 0;
}