Yet Another Cute Girl
All submissions for this problem are available.
Read problems statements in Mandarin Chinese and Russian.
Chef doesn't love math anymore. He loves Sasha. Sashen'ka is cute.
Chef goes on a date with her. Flowers are boring, while numbers are not. He knows that most of all this girl loves numbers, that's why he is going to bring ribbon with numbers L, L+1, L+2, ..., R written on it.
Sasha thinks that numbers with prime number of divisors are special. That's why she is going to kiss boy for each such number he will bring.
Now Chef wonder how many times he will be kissed by Sashen'ka ?
InputThe first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The first line of each test case contains two number L, R.
OutputFor each test case, output a single line containing answer for corresponding test case.
- 1 ≤ T ≤ 5
- 1 ≤ L ≤ R ≤ 1012
- 0 ≤ R-L ≤ 106
Input: 1 1 10 Output: 6
Example case 1. Numbers 2,3,4,5,7,9 are special.
|Tags||ballon_ziq, easy, nov13, prime-factor, sieve|
|Time Limit:||1 - 2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, 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, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions