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
",cnt);
}
return 0;
}