https://github.com/flacode/day2
Project Euler #1: Multiples of 3 and 5
https://github.com/flacode/day2
Last synced: about 1 year ago
JSON representation
Project Euler #1: Multiples of 3 and 5
- Host: GitHub
- URL: https://github.com/flacode/day2
- Owner: flacode
- Created: 2015-10-29T21:07:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-29T22:28:43.000Z (over 10 years ago)
- Last Synced: 2025-01-26T18:46:06.233Z (over 1 year ago)
- Language: Python
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# day2
Project Euler #1: Multiples of 3 and 5
Problem Statement
This problem is a programming version of Problem 1 from projecteuler.net
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below N.
Input Format
First line contains T that denotes the number of test cases. This is followed by T lines, each containing an integer, N.
Output Format
For each test case, print an integer that denotes the sum of all the multiples of 3 or 5 below N.
Constraints
1≤T≤105
1≤N≤109