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
10191019
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
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 ).
For each case please print the sum of 12 + 22 + 32 + ... + N2.
1
5
55
Easy Problem.