Number of rectangles

Source: Internet
Author: User

Number of rectangles

Description

In a 3*2 rectangle, you can find 6 1*1 and 4 2*1 and 3 1*2 Rectangles and 2 2*2 and 2 3*1 and 1 3*2 rectangle, A total of 18 rectangles.

Returns A and B, and calculates the number of rectangles that can be found.

Input

There are multiple groups of input data (<10000) in this question. You must process the EOF.

Enter two integers A, B (1 <= A, B <= 2000)

Output

Output The number of rectangles.

Sample Input

1 2
2 3

Sample output

3
18
#include <iostream>#include <cstring>#include <cstdio>#include <algorithm>using namespace std;int main(){   long long n,m,sum;   while(cin>>n>>m)   {       sum=0;       for(int i=1;i<=n;i++)        for(int j=1;j<=m;j++)        {            sum+=i*j;        }        cout<<sum<<endl;   }  return 0;}



Number of rectangles in C Language

I don't know what the author means by saying "Yes is wrong.
I used VC ++ 6.0 to copy the landlord's code and compile and run it.
Test cases:
2 3
18
4 5
150
6 7
588

Which of the following is the number of Rectangles?

45, 48, 57
72, 95

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.