#K6516. Sum of Squares
Sum of Squares
Sum of Squares
Given an integer n, compute the sum of the squares of the first n positive integers. Formally, if n \ge 1, you need to calculate the value of \(\sum_{i=1}^{n}{i^2}\). If n is less than 1, the result is defined to be 0.
Example: For n = 5, the answer is \(1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55\).
You should read the input from standard input and output your answer to standard output.
inputFormat
The input consists of a single integer n provided via standard input.
Constraints:
- n can be negative, zero, or positive.
outputFormat
Output a single integer which is the sum of squares of the first n positive integers if n \ge 1, or 0 if n is less than 1. The result should be written to standard output.
## sample5
55