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:
2014-01-22 14:28:31
@N. K.
|
|
N. K.:
2014-01-19 10:28:12
what if the input :
|
|
Md. Baker Hossen:
2014-01-17 15:15:32
----Adam Dzedzej
|
|
appy:
2014-01-16 09:31:15
tle error...how to do such programs....can sum1 explain any algo associated with dis problem |
|
Cristian Maruan Bosin:
2014-01-09 20:45:19
I have no idea why my code is taking so much time to run.. I've tried lots of times different submissions and all of those has the same problem.. Is this just happening to me ?? :/ (problem: time limit exceeded)
|
|
Douglas De Rizzo Meneghetti:
2014-01-09 17:16:15
Hey guys, I solved it, but when I submit, I receive a SIGSEGV. Can someone spot the mistake?
|
|
Micha³ Klawikowski:
2014-01-07 18:56:43
@Babita u're scanning only 10 first digits, no matter how many cases is bound to be done.
|
|
Babita Naagar:
2014-01-05 05:35:01
I have written the code, it runs perfectly on ideone too, but here it is showing a run time error. I have read it several times but haven't been able to spot any error. Please help.
|
|
Rishiraj:
2014-01-02 19:56:15
are "Command line arguments" valid ??? |
|
Sahebjot Singh:
2014-01-02 19:05:14
I am getting wrong answer as the reply,
|
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 |