100% Guaranteed Results


Project Euler #1: Multiples of 3 and 5 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 1 from projecteuler.net
If we list all the natural numbers below that are multiples of or , we get and . The sum of these multiples is .
Find the sum of all the multiples of or below .
Input Format
First line contains that denotes the number of test cases. This is followed by lines, each containing an integer, .
Constraints

Output Format
For each test case, print an integer that denotes the sum of all the multiples of or below .
Sample Input 0

Sample Output 0

Explanation 0
For , if we list all the natural numbers below that are multiples of or , we get and . The sum of these multiples is
Similarly for , we get .

Reviews

There are no reviews yet.

Be the first to review “Project Euler #1: Multiples of 3 and 5 Solved”

Your email address will not be published. Required fields are marked *

Related products