Find the minimum sum of weightage of the triangles formed by joining the vertices of a n sided regular polygon numbered from 1 to n in counter-clockwise direction. Sum of the area of all the triangles must equal to the area of the polygon and
any two triangles must share a common regin.
Note :- Weightage of the triangle is the product of numbers assigned to its vertices.
Explanation:
In Fig.1, △(1,4,5), △(2,4,5) have a intersection coloured with orange while △(1,5,6) and △(2,3,4) do not have any common region with any triangle so fig.1 is discarded.
In Fig.2, if we take any two triangles then they have at lesat a small region (coloured in red) in common. And the sum of the area of triangles △(1,3,4)△(2,3,4)△(3,4,5)△(3,4,6) is equal to the area of the hexagon.
In Fig.3, there is no common region between any two triangles so it is also discarded.
Input
First line of the input consist a integer t denoting the number of test cases.
Next t lines contain a integer n , number of sides in a regular polygon.
Output
For each test case print a single line containing minimum sum of weightage of triangles. If not possible print −1
Constraints
1<=t<=105
1<=n<=107
For n=2, we cannot form any polygon so answer is −1.
For n=4, triangle (1,2,3) and (1,2,4) gives us the minimum weightage 1∗2∗3+1∗2∗4=14. And satisfying the condition of all 2 triangles having common area with vertices (1,2,5).