#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> R >> C; if(R%2==1 && C%2==1){ ll area = R*C; area--; // center area /= 2; if(R==C) area /= 2; area++; // add center p(area-1); return 0; }else{ ll ans = (R*C+1)/2; if(R==C) ans /= 2; p(ans-1); } return 0; }