#K2441. Summing Even Numbers
Summing Even Numbers
Summing Even Numbers
Given an integer \( n \), your task is to compute the sum of all even numbers in the range from 1 to \( n \) (inclusive). If \( n \) is less than 1, then no numbers can be summed, and the answer is 0.
Details: Only even numbers (i.e., numbers divisible by 2) should be considered for the sum. For example, if \( n = 10 \), then the even numbers are 2, 4, 6, 8, and 10, and their sum is 30.
You are required to read the input from standard input (stdin) and write the output to standard output (stdout).
inputFormat
A single integer ( n ) provided on one line via standard input.
outputFormat
A single integer representing the sum of all even numbers from 1 to ( n ). If ( n ) is less than 1, output 0.## sample
10
30