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
vlhaierx:
20151118 22:52:21
sudhabindu, use raw_input() 

johnsthomason:
20151104 20:18:06
Thanks! Last edit: 20151104 20:47:57 

Shidhu :
20151104 17:31:54
please help someone. i am getting runtime error. but why ? 

Shidhu :
20151104 17:30:13
why i am getting runtime error ?? 

Shidhu :
20151104 17:29:59
why i am getting runtime error ?? 

HEMANTH SAVASERE:
20151101 16:38:54
nice problem


sudhabindu:
20151101 11:32:51
how to read the lines in python....i am using input() but it says EOF while reading a line 

iamwgp:
20151031 20:40:12
Use Math.sqrt(k)+1 for getting speed. 

syukri:
20151027 14:15:23
HEY !!! MR. ANKIT KUMAR, PLEASE DONT PUT SOLUTION IN COMMENT


faishal28:
20151026 16:16:53
Nice problem just remember p(n) can be written as 6k + 1 and try to keep complexity between M*N^(1/2). Last edit: 20151026 16:20:16 
Added by:  Adam Dzedzej 
Date:  20040501 
Time limit:  6s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel Pentium G860 3GHz) 
Languages:  All except: NODEJS PERL 6 