#include<cstdio>
int main()
{
#ifdef LOCAL
freopen("in.txt","r",stdin);
#endif // LOCAL
int T;
scanf("%d",&T);
while(T--)
{
int N,M;
scanf("%d%d",&N,&M);
N -= 2;
M -= 2;
int r = N / 3;
if(N % 3 != 0)r++;
int c = M / 3;
if(M % 3 != 0)c++;
int result = r * c;
printf("%d\n",result);
}
return 0;
}
uva 11044 - Searching for Nessy
最新推荐文章于 2019-05-02 08:39:00 发布