Back
Close

lot of sums

Statement

 Goal

For all numbers less or equal to n, you must return the difference between the sum of all the numbers divisible by 3 and the sum of even numbers.
Input
one integer n
Output
one integer : the difference between the two sums.
Constraints
0 <= n <= 100000
Example
Input
5
Output
-3

Game modes
Fastest

Test cases
Test 1 Test
Input
5
Output
-3

Test 2 Validator
Input
13
Output
-12

Test 3 Test
Input
6
Output
-3

Test 4 Validator
Input
10
Output
-12

Test 5 Test
Input
21
Output
-26

Test 6 Validator
Input
1
Output
0

Test 7 Test
Input
237
Output
-4562

Test 8 Validator
Input
99999
Output
-833266667

Solution language

Solution

Stub generator input