#K95797. Sum of Multiples
Sum of Multiples
Sum of Multiples
Given an integer N, compute the sum of all natural numbers between 1 and N (inclusive) that are multiples of either 3 or 5.
You need to consider all numbers i (where \(1 \leq i \leq N\)) and add it to the sum if either \(3\) or \(5\) divides \(i\) evenly.
For example, if \(N = 10\), the multiples are 3, 5, 6, and 9 and their sum is \(33\).
inputFormat
The input consists of a single line containing one integer (N) (where (1 \leq N \leq 10^6)).
outputFormat
Output a single integer, which is the sum of all numbers between 1 and (N) (inclusive) that are multiples of 3 or 5.## sample
10
33
</p>