From 80a06c20a6b689f46300e55f83bfd614e7a51b4e Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 28 Apr 2016 08:58:45 +0800 Subject: [PATCH] Create 1228.c --- QUSTOJ/1228.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 QUSTOJ/1228.c diff --git a/QUSTOJ/1228.c b/QUSTOJ/1228.c new file mode 100644 index 0000000..13a7ef4 --- /dev/null +++ b/QUSTOJ/1228.c @@ -0,0 +1,29 @@ +#include +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; +}