Squares in a Matrix
Submissions: 6921   Accuracy:

32.95%

  Difficulty: Basic   Marks: 1
Associated Course(s):   Sudo Placement 2019

Given a MxN matrix, count the number of squares in the matrix.squaresinREct

Input:

The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains two space seperated integers M and N, denoting the size of the Matrix.
Output:

For each test output a single integer denoting the total number of squares.
Constraints:

1<=T<=102
1<=M,N<=10^4

Example:

Input:

2
2 2
4 3

Output:

5
20

** For More Input/Output Examples Use 'Expected Output' option **

Author: harshitsidhwa


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.