nice-quadrilaterals
Source: hackerearth
Difficulty: UNKNOWN_DIFFICULTY

Mira is very fond of gifts, so this valentine-season, Krish is going to gift her a game Nice Quadrilaterals (Yeah! Krish is such a geek!).
The game shows a convex Polygon of N-sides. And the game defines a Nice Quadrilateral as 
  "A quadrilateral made up of points from the given N-Polygon and which shares At least 2 edges to the original Polygon". 
Now given a convex N-polygon, Mira has to answer how many Nice Quadrilaterals she can draw.

Mira is not in a mood to start with this geek-freak game so she asks for your help. 

Input:

 First line with a T, the number of test cases.
 Then T lines follow, each with a number N.

Output:

 For each test case, output the Number of Nice Quadrilaterals for given N, on a new line.

Constraints:

  1 ≤ T ≤ 100000
   0 ≤ N ≤ 10^9+7;

SAMPLE INPUT
3
4
5
6

SAMPLE OUTPUT
1
5
15

Explanation

Case 1: for N=4, only one Nice Quadrilateral is possible.

Case 2 and Case 3: For N=5 or N=6, selecting any 4 points will give at least 2 edges from the original Polygon.