Lucky Numbers Again
All submissions for this problem are available.
A lucky number N is defined as a number which has only two factors, both of them distinct and prime and the absolute difference between the two factors is not more than 50.
Given two integers, a and b, find the total lucky numbers in the range a to b (inclusive).
1.The first input will be T, the number of test-cases. T <= 2000. T lines follow, one for each test case.
2.For each test case there are two integers a and b on each line. 1 <= a <= b <= 100000
For every test case, print the number of lucky numbers from a to b (inclusive).
Input: 1 1 20
Explanation From 1 to 20, there are four lucky numbers, 6,10, 14, and 15.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 4.9.2, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.4, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.