Sum of squares of numbers from 1 to N
Rust
Easy
math
Task «Sum of squares of numbers from 1 to N»
Given a natural number N (1 ≤ N ≤ 1000), calculate the sum of squares of numbers from 1 to N. For example, for N=3 the sum is 1² + 2² + 3² = 1 + 4 + 9 = 14.
Input Format
One integer N (1 ≤ N ≤ 1000).
Output Format
One integer — the sum of squares of numbers from 1 to N.
Examples
Example 1
INPUT
6
4 4 2 2 2 8
OUTPUT
91
main.rs