PRINT  Prime Intervals
In this problem you have to print all primes from given interval.
Input
t  the number of test cases, then t lines follows. [t <= 150]
On each line are written two integers L and U separated by a blank. L  lower bound of interval,
U  upper bound of interval. [2 <= L < U <= 2147483647] [UL <= 1000000].
Output
For each test case output must contain all primes from interval [L; U] in increasing order.
Example
Input:
2 2 10 3 7
Output:
2 3 5 7 3 5 7
hide comments
code0monkey1:
20180217 16:45:56
really helpful video tutorial ( the tutorial is partially in Hindi , so it would be difficult for nonHindi speaking people to understand what the presenter is saying ) based on this specific question : https://www.youtube.com/watch?v=fByR5NTseY&t=650s 

sanyam19:
20180108 15:30:45
took 2 hrs... but finally done... :))


captaindavinci:
20171016 18:46:12
Why does Rabin Miller test with memoization not work for this problem? Isn't Rabin Miller a logarithmic computation with fast modular exponentiation.


kchiranjewee69:
20171009 17:04:07
solved in 0.2second


vasilis:
20170922 21:02:06
Anyone managed to run this with Java? 

elegantalgo:
20170625 04:37:31
Solved it in python! :D Execution time: 0.61 sec :D :D Last edit: 20170730 04:10:21 

lucifer_786:
20170618 12:46:21
Same as PRIME1 , just used fast i/o ;) 

rohijulislam:
20170603 08:07:20
For avoiding TLE


hacker_sk:
20170213 16:21:39
AC in 0.18 sec ... mine 15th position .. LOL just use fast i/o ans optimized segmented sieve :D 

soodan:
20161206 06:50:11
implement segmented sieve 
Added by:  Roman Sol 
Date:  20050328 
Time limit:  1.223s 
Source limit:  15000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  ZCon 