Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/kvadratlar-yigindisi

Sum of squares

Easy 1000 ms 64 MB 24%
Share

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}$$

The sum of the areas of squares

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

Sign in to submit a solution

Signing up is free and takes a minute.