100 atcoder#ABC162B. [ABC162B] FizzBuzz Sum
[ABC162B] FizzBuzz Sum
Score : points
Problem Statement
Let us define the FizzBuzz sequence as follows:
- If both and divides , .
- If the above does not hold but divides , .
- If none of the above holds but divides , .
- If none of the above holds, .
Find the sum of all numbers among the first terms of the FizzBuzz sequence.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the sum of all numbers among the first terms of the FizzBuzz sequence.
15
60
The first terms of the FizzBuzz sequence are:
$1,2,\text{Fizz},4,\text{Buzz},\text{Fizz},7,8,\text{Fizz},\text{Buzz},11,\text{Fizz},13,14,\text{FizzBuzz}$
Among them, numbers are , and the sum of them is .
1000000
266666333332
Watch out for overflow.