https://hastebin.com/aporifisiq.cpp
please tell whether it passes all test cases or not . is it the correct approach??
https://hastebin.com/aporifisiq.cpp
please tell whether it passes all test cases or not . is it the correct approach??
@gulatigarvita08 no one divides the prime number except the number itself and 1, so ans for any n should be 2 . what are you trying to say? can you give an example.
also your code gives o/p 9 for i/p 10 which is wrong
find out number of numbers between 1 and n which are divisible by any of the primes less than 20 .
first line consists of number of test cases . then t lines follow which consists of number n for each test case.
sample input
5
5
10
12
15
18
sample output
4
9
11
14
17
@gulatigarvita08 its giving right for cases i tried ( compared it with the brute force soln and answer matches) , so it seems correct 
if cleared dont forget to hit like and mark resolved
can you please explain me its time complexity…
so finally o(txn) ??
actually i don’t have much idea on complexity …what’s o(1e6) ?? is it constant
o(1e6) ?? am not asking 1e6
consider a loop which runs from i=0, i<var ; i++ where var=1e6 . so complexity o(var) which is also o(1e6)
okay okay …thank you so much…
can there be more optimized approach for the same
okay…thank you so much…
np garvita just mark it as resolved 