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:||0.241463 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, 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, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.