Number that are not divisible
Submissions: 6916   Accuracy:

32.07%

  Difficulty: Easy   Marks: 2

You will be given a positive integer N. Your task is to find the number of positive integers K ≤ N such that K is not divisible by any number among the set {2,3,4,5,6,7,8,9,10}.

 

Input:
The first line of input contains a single integer T denoting the number of test cases.
Then T test cases follow. The first and only line of each test case consists of N.

 

Output:
Corresponding to each test case, in a new line, print the number positive integers less than or equal to N which are not divisible by any number from 2 to 10.

 

Constraints:
1 ≤ T ≤ 200
1 ≤ N ≤ 1018

 

Example:

Input
3
200
400
500

Output
47
91
115

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

Author: Hemang Sarkar


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.