#C7279. Sum of Squares of Natural Numbers
Sum of Squares of Natural Numbers
Sum of Squares of Natural Numbers
Given a positive integer \(N\), compute the sum of the squares of the first \(N\) natural numbers. The mathematical formula for the sum is given by:
[ S = \frac{N(N+1)(2N+1)}{6} ]
Your task is to read an integer from standard input, compute the value of \(S\) using the formula above, and write the result to standard output.
inputFormat
A single line containing one integer (N) where (1 \le N \le 10^7).
outputFormat
A single integer representing the sum of squares of the first (N) natural numbers.## sample
3
14