Skip to content

Instantly share code, notes, and snippets.

@ateruimashin
Created May 28, 2020 20:58
Show Gist options
  • Save ateruimashin/60dd19ab2c9a34177e0261418c4a7ce3 to your computer and use it in GitHub Desktop.
Save ateruimashin/60dd19ab2c9a34177e0261418c4a7ce3 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i,s,n) for(int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
ll h, w;
cin >> h >> w;
if(h==1||w==1){
cout << 1 << endl;
}else{
cout << (h * w + 1) / 2 << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment