#K74522. Sum of Even Numbers

    ID: 34216 Type: Default 1000ms 256MiB

Sum of Even Numbers

Sum of Even Numbers

Given a positive integer \(n\), compute the sum of all even numbers from 1 to \(n\) (both inclusive). In mathematical terms, you are required to calculate the sum

\(S = \sum_{k=1}^{\lfloor n/2 \rfloor} 2k\)

For example, if \(n = 10\), the even numbers are 2, 4, 6, 8, 10 and their sum is 30.

inputFormat

The input is provided via standard input (stdin) and consists of a single integer (n) ((1 \le n \le 10^5)).

outputFormat

The output should be printed to standard output (stdout) as a single integer, representing the sum of all even numbers from 1 to (n).## sample

10
30