Rectangle A + B

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.