Back
Close

Even sum

Statement

 Goal

You must ouput the sum of the first N even natural numbers.
For example, if N=4 we get 2, 4, 6, 8 and the sum of these numbers is 20.
Input
Line 1: An integer N for the number of even natural numbers to sum.
Output
Line 1 : The sum.
Constraints
0 ≤ N ≤ 10^9
Example
Input
4
Output
20

Game modes
Fastest, Shortest

Test cases
Test 1 Test
Input
4
Output
20

Validator 1 Validator
Input
4
Output
20

Test 2 Test
Input
5
Output
30

Validator 2 Validator
Input
5
Output
30

Test 3 Test
Input
2
Output
6

Validator 3 Validator
Input
2
Output
6

Test 4 Test
Input
1
Output
2

Validator 4 Validator
Input
1
Output
2

Test 5 Test
Input
10
Output
110

Validator 5 Validator
Input
7
Output
56

Test 6 Test
Input
3
Output
12

Validator 6 Validator
Input
8
Output
72

Test 7 Test
Input
2000
Output
4002000

Validator 7 Validator
Input
1000
Output
1001000

Crash test Test
Input
1000000000
Output
1000000001000000000

Crash test Validator
Input
100000000
Output
10000000100000000

Solution language

Solution

Stub generator input