eolymp
bolt
Try our new interface for solving problems
Problems

Counting Triangles

Counting Triangles

We define the LEVEL of a triangle as in the following illustrative image: \includegraphics{https://static.e-olymp.com/content/60/60156485f8c08ad0dcbfc146e013c22102d36b9c.gif} You have to count all triangles in the biggest one (level $n$). \InputFile The first line contains the number of test cases $t~(t \le 10000$). Each line contains an integer $n~(1 \le n \le 10^6)$ which is the level of the triangle in that test case. \OutputFile For each test case, you should write a separate line: the number of triangles in the biggest one (level $n$). All answers will fit within the range of a $64$-bit integer.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
1
2
3
Output example #1
1
5
13