Create 1228.c

This commit is contained in:
KiritoTRw 2016-04-28 08:58:45 +08:00
parent 4734ada571
commit 80a06c20a6

29
QUSTOJ/1228.c Normal file
View File

@ -0,0 +1,29 @@
#include <stdio.h>
int main()
{
int all,maxl,maxh;
int square,box;
int l,h;
scanf("%d",&all);
for(;all>0;all--)
{
square=0;box=0;
scanf("%d %d",&maxl,&maxh);
for(l=1;l<=maxl;l++)
{
for(h=1;h<=maxh;h++)
{
if(l==h)
{
square+=(maxl-l+1)*(maxh-h+1);
}
else
{
box+=(maxl-l+1)*(maxh-h+1);
}
}
}
printf("%d %d\n",square,box);
}
return 0;
}