http://acm.hdu.edu.cn/showproblem.php?pid=2524
/*
首先考虑行 : 1格 : n个 2格: n-1个 …. 共有 n * (n+1) /2 种
同理 列 也是 m * ( m + 1 ) / 2 种方式,
接下来就是组合起来 :(n*(n+1)*m*(m+1)/4) 种
*/
#include <stdio.h>
int main()
{
int t,n,m;
scanf("%d",&t);
while(t--)
{
scanf("%d %d",&n,&m);
printf("%d\n",n*(n+1)*m*(m+1)/4);
}
return 0;
}