Sum up even number from 2 to N
Statement
Goal
Given a number N sum up all even numbers from 2 to N.Input
Line 1: The number N
Output
Line 1: An integer K, the sum of all even numbers in the range 2 to N (Inclusive).
Constraints
2 <= N <=10000
2 <= K <= 25005000
2 <= K <= 25005000
Example
Input
10
Output
30
Game modes
Fastest, Shortest
Test cases
10 Test
Input
10
Output
30
Validator 1 Validator
Input
100
Output
2550
2 Test
Input
2
Output
2
Validator 2 Validator
Input
3
Output
2
458 Test
Input
458
Output
52670
Validator 3 Validator
Input
460
Output
53130
10000 Test
Input
10000
Output
25005000
Validator 4 Validator
Input
1558
Output
607620
7899 Test
Input
7899
Output
15598550
Validator 5 Validator
Input
500
Output
62750
5 Test
Input
5
Output
6
Validator 6 Validator
Input
20
Output
110
55 Test
Input
55
Output
756
Validator 7 Validator
Input
1569
Output
615440
667 Test
Input
667
Output
111222
Validator 8 Validator
Input
699
Output
122150
Solution language
Solution
Stub generator input