TDTM’s Bus Service Rockz
All submissions for this problem are available.There are numerous bus stops in TDTM College of Engineering. TDTM has a very special system of bus service with a special rule. The rule states that “A bus originating at a bus stop i will stop at a bus stop which is divisible by i only and a bus can originate only at a bus stop which is prime”. For example, a bus originating at bus stop 3 will stop at bus stop 6, 9, 12, ... etc. The Director of TDTM College doesn’t like prime numbers so he plans to set up benches at the non-prime bus stops only. He knows that you like prime numbers very much and asks you to help him find number of benches that are to be set up. Bus stops are numbered from 1 to $N$. ###Input: - First line of input consists of a number T, the number of test cases. - Each line of a test case will consist of a number N , the total number of bus stops in TDTM College of Engineering. ###Output: For each test case output a single line, the answer to the query. ###Constraints - $1 \leq T \leq 100000$ - $2 \leq N \leq 5*10^6$ ###Sample Input: 2 5 10 ###Sample Output: 2 6
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.