1^2+2^2+...+n^2

Time limit: 5000ms
Memory limit: 256mb

Description:
Calculate 1^2+2^2+...+n^2.

Input:
There is a single positive integer n on the first line of input, 1 <= N <= 10000.
Output:
You should output only one line which contains an integer that equals to 1^2+2^2+...+n^2.

Sample input:
2

Sample output:
5

Hint:
You can use long long int to hold the answer
  long long int answer;
and use
  printf("%lld\n", answer);
to output it.
Submit