#CCBOTPBA0000010. Sum of Consecutive Even Numbers
Sum of Consecutive Even Numbers
Sum of Consecutive Even Numbers
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive X, sum the first five consecutive even integers beginning at the smallest even integer greater than or equal to X.
Input
One positive integer X. This version handles one value; do not append the original 0 sentinel.
Output
Print the sum of the five even integers.
Subtasks
-
Subtask 1 (20%):
1 ≤ X ≤ 20. -
Subtask 2 (30%):
1 ≤ X ≤ 1000. -
Subtask 3 (50%):
1 ≤ X ≤ 10^9.
Examples
Example 1
Input:
4
Output:
40
Explanation: The numbers 4, 6, 8, 10, 12 sum to 40.
Example 2
Input:
7
Output:
60
Explanation: The numbers 8, 10, 12, 14, 16 sum to 60.