PRIME1  Prime Generator
Peter wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all prime numbers between two given numbers!
Input
The input begins with the number t of test cases in a single line (t<=10). In each of the next t lines there are two numbers m and n (1 <= m <= n <= 1000000000, nm<=100000) separated by a space.
Output
For every test case print all prime numbers p such that m <= p <= n, one number per line, test cases separated by an empty line.
Example
Input: 2 1 10 3 5 Output: 2 3 5 7 3 5Warning: large Input/Output data, be careful with certain languages (though most should be OK if the algorithm is well designed)
Information
After cluster change, please consider PRINT as a more challenging problem.hide comments
noxiousav:
20160504 16:51:46
My code works in my ide and also ideone.com but here it says Time limit has exceeded. 

d_griffin_101:
20160503 18:40:10
My code works. I use the ide compiler and it works. Yet when I submit it, it says that the time limit has exceeded itself. 

ducanswap:
20160425 04:38:42
sol : count all prime numbers smaller than sqrt 1000000000 (31622) so we have an array a(1..3401) of prime nb


ace_of_spades:
20160423 10:58:11


hrithik_sethia:
20160417 12:55:14
help:tle


sushanth:
20160415 12:14:05
Will Fermat primality test work? 

jyoti_gambhir:
20160414 11:46:36
my code is running well on my jdk but its giving runtime error on ideone.why is it so?


khouloud1:
20160409 16:55:47
hey; where can i find the evaluation of my code :( ? 

adv010:
20160409 06:56:25
TLE!!!! 

milosrs:
20160408 17:32:37
Guys, how can I see where I get the wrong answer, runtime errors etc? 
Added by:  Adam Dzedzej 
Date:  20040501 
Time limit:  6s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL 6 