Time limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total Submission (s): 5206 Accepted Submission (s): 4046
Problem description gives you a grid with a height of N and a M column, and calculates how many rectangles are in this grid, a grid with a height of 2 and a width of 4.
Input the first line to enter a T, indicating that there is a T group of data, and then enter N,m per row, representing the height and width of the grid (N <, m < 100).
Outputs how many rectangles are in the output grid for each row.
Sample Input
21 22 4
Sample Output
330
#include <stdio.h>int main () {int i,j,k,c,n,m;scanf ("%d", &n); __int64 A,b;//long long A, b; __int64 x[1000]; X[1]=1; x[2]=3; for (i=3;i<111;i++) x[i]=x[i-1]+i;while (n--) {scanf ("%i64d%i64d", &a,&b);//if (a<=0| | b<=0)//{//printf ("error\n"),//continue;//}//printf ("%lld\n", ((a+1) *A/2) * (b* (b+1)/2));p rintf ("%i64d\n", x[a]* X[B]);} return 0;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Rectangle A + B