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, n-m<=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
Sayed Jaffar:
2013-12-23 16:38:47
I have one question..
|
|
Rohan Jitendra Pota:
2013-12-22 08:45:34
[code removed]
|
|
ritu:
2013-12-20 09:46:58
tle :( u have told reason of tle in previous comment but i didn't get it .. pls explain it |
|
Pranav Zarekar:
2013-12-17 14:31:20
TLE.. :(
|
|
Mitch Schwartz:
2013-12-15 10:18:10
@Rohan: I deleted your latest comment for obvious reasons. conio.h is not part of standard C, so there's nothing unusual at all about that error message. http://en.wikipedia.org/wiki/Conio.h |
|
Rohan Jitendra Pota:
2013-12-15 07:00:55
conio.h: No such file or directory
|
|
p@dfoot:
2013-12-12 16:57:50
my program is running perfectly on my pc but here they have not given the input correctly |
|
Viraj:
2013-12-10 04:20:55
How do we see what tests SPOJ is running on our code? |
|
Washington:
2013-12-05 11:10:07
lol. The author himself could not solve the problem. |
|
Dhruv Mullick:
2013-11-30 17:08:40
Getting a SIGSEGV error in this
|
Added by: | Adam Dzedzej |
Date: | 2004-05-01 |
Time limit: | 6s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS PERL6 |