New update is available. Click here to update.

Rectangles In N x N Board

Posted: 25 Feb, 2021
Difficulty: Moderate

PROBLEM STATEMENT

Try Problem

You are given a positive integer N. Your task is to find the number of possible rectangles, excluding squares, in a N x N chessboard.

Example:
Let’s assume that we have a chessboard of dimension 4x4, i.e. N = 4. Then the rectangles can have the following possible dimensions: {1*2, 1*3, 1*4, 2*1, ……, 2*4, ………,4*4}. So, the total number of rectangles in the chessboard is 70.
Input format:
The very first line of input contains an integer T’ denoting the number of test cases. 

The first line of every test case contains an integer ‘N’ denoting the dimension of the chessboard.
Output format:
For each test case, print the number of possible rectangles, excluding squares, in a N x N chessboard.

Output for each test case is printed on a separate line.
Note:
The result can be very large. So, print the answer modulo 1000000007.

You do not need to print anything, it has already been taken care of. Just return the number of possible rectangles. 
Constraints:
1 <= T <= 10 
1 <= N <= 5 * 10^4

Time Limit: 1 sec