mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1228.c
This commit is contained in:
parent
4734ada571
commit
80a06c20a6
29
QUSTOJ/1228.c
Normal file
29
QUSTOJ/1228.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user