#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==1 && C==1){ p(0); return 0; } ll ans = (R*C+1)/2; if(R==C) ans /= 2; p(ans-1); return 0; }