Company: IBM_19nov
Difficulty: medium
Number of Ways to Choose Cables Problem Description A box holds ethernet cables laid out in a grid of rows rows and columns columns. A square region of side a is any block of a consecutive rows and a consecutive columns of that grid. Two square regions are different when their positions differ, even if they have the same size. For each query [rows, columns] , count every square region of every allowed side length, that is every a with 1 <= a <= min(rows, columns) , and report the total. Implement numberOfWays(queries) , which receives the list of queries and returns one count per query, in order. The counts can exceed the range of a 32 bit integer, so use a 64 bit type. Input Format The first line contains the integer n , the number of queries. Each of the next n lines contains two integers rows and columns . Output Format Print the n answers on one line , separated by single spaces, in query order. Constraints 1 <= n <= 1200 1 <= rows, columns <= 2500 Examples Exampl