10191019 SUSTech Online Judge
Problem 1019 --Sum of Squares

1019: Sum of Squares

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1092  Solved: 287
[Submit][Status][Web Board]

Description

In CS203 class, given an integer N, you know how to calculate 1 + 2 + 3 + … + N. This time, Bo Huang wants you to compute 12 + 22 + 32 + ... + N2

Input

The first line will be an integer T(1<T<=1000), which is the number of test cases.

For each test data, you will be given an integer N (1 <= N <= 106 ).

Output

For each case please print the sum of 12 + 22 + 32 + ... + N2.

Sample Input

1
5

Sample Output

55

HINT

Easy Problem.

Source

[Submit][Status]