ALGOR Contest: Round #4 (Special Challenge)
Problem E · 200 points ·
ICPC rules
~/algor $ cat contests/round-4/E
E. Sum of squares
1000 ms
64 MB
A positive integer $N$ is given. Compute the sum of the squares of the first $N$ positive integers:
$$S = 1^{2} + 2^{2} + 3^{2} + \dots + N^{2}$$
Input
One positive integer $N$.
Output
One integer — the sum of squares.
Note
$1 \le N \le 1000$
Examples
Input #1
3
Output #1
14
Input #2
5
Output #2
55