#P2532. Sum of Squares

    ID: 15802 Type: Default 1000ms 256MiB

Sum of Squares

Sum of Squares

Given a positive integer \(n\), compute the sum of squares of the first \(n\) natural numbers. The sum is defined by the formula:

\[ S(n) = \frac{n(n+1)(2n+1)}{6} \]

Your task is to calculate \(S(n)\) for the given input.

inputFormat

The input consists of a single positive integer \(n\) (1 \(\leq n\)).

outputFormat

Output a single integer representing the sum \(S(n)\) computed by the formula.

sample

1
1