P18673 [HackerEarth] 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!).
普及
题目描述

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.

输入格式

见题面

输出格式

见题面

样例输入
4 299 710 132 568
样例输出
726269 633418 38794 287540 1206458 129500 1060494 7100 3869 854653 604513 11565 1203769 205158 275840 67940 295475 15855 188853 644 245828 1347575 1373288 342480 891269 1443044 20468 208500 19090 1003270 841120 37835 325494 1236235 530733 196378 456773 926294 275840 541494 1190369 258123 707603 923938 919235 325494 1490508 75818 481943 738848 89175 156325 629525 455119 957195 886650 422669 1252630 29744 1481550 10285 86273 34119 448533 371750 13769 1233513 3425 1161153 707603 627583 21894 306223 703488 1228078 81310 33220 95123 978885 766473 1358973 242198 1919 1353268 1356119 51238 772920 345353 14058 65410 333933 421078 299483 1419600 8619 1333395 6693 166160 1466680 1339058 205158 1457794 6298 1008183 671000 153433 243405 1000818 1274658 471794 1166438 1140133 1384794 107595 44283 1244419 304869 1182365 823244 1209150