The chef is trying to solve some series problems, Chef wants your help to code it. Chef has one number N. Help the chef to find N'th number in the series.
0, 1, 5, 14, 30, 55 …..
-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, one integer $N$. 
-----Output:-----
For each test case, output as the pattern.
-----Constraints-----
- $1 \leq T \leq 10^4$
- $1 \leq N \leq 10^4$
-----Sample Input:-----
3
1
7
8
-----Sample Output:-----
0
91
140
# your code goes here
for _ in range(int(input())):
    n=int(input())
    n=n-1
    k=n*(n+1)*(2*n + 1)
    print(int(k/6))

# your code goes here
for _ in range(int(input())):
    n=int(input())
    n=n-1
    k=n*(n+1)*(2*n + 1)
    print(int(k/6))
