Multiples Power
Submissions: 3358   Accuracy:

19.69%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Calculate the sum of all the multiples of 3 or 7 below the natural number N.

Input:
First line contains T that denotes the number of test cases. For each test case there will be single line which contains an integer N.

Output:
For each test case, print an integer that denotes the sum of all the multiples of 3 or 7 below N.

 

Constraints:
1  ≤ T  ≤  50
1  ≤  N ≤  1000000

Example:
Input:
2
10
20

Output:
25
84

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: karan kumar
Author: karanshrm44


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.