All submissions for this problem are available.
Shridhar wants to generate some prime numbers for his cryptosystem. Help him please!
Your task is to generate all prime numbers between two given numbers.
The first line contains t, the number of test cases (less then or equal to 10).
Followed by t lines which contain two numbers m and n (1 <= m <= n <= 1000000000, n-m<=100000) separated by a space.
For every test case print all prime numbers p such that m <= p <= n,
one number per line. Separate the answers for each test case by an empty line.
Input: 2 1 10 3 5 Output: 2 3 5 7 3 5
Warning: large Input/Output data, be careful with certain languages (though most should be OK if the algorithm is well designed)
|Time Limit:||2 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, 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, TEXT|
Fetching successful submissions
If you are still having problems, see a sample solution here.