Gym - 101810D ACM International Collegiate Programming Contest (2018)
bryce1010模板
http://codeforces.com/gym/101810
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int t;
scanf("%d",&t);
ll n,m;
while(t--)
{
scanf("%lld%lld",&n,&m);
ll cnt=0;
if(m>n)swap(m,n);
for(ll i=0;i<m;i++)
{
cnt+=(n-i)/2;
cnt+=(n-i)%2;
cnt+=(m-i-1)/2;
cnt+=(m-i-1)%2;
}
printf("%lld\n",cnt);
}
return 0;
}