TWINP - TWIN PRIMES
Twin primes are the pair of prime numbers that differ by two. For example:
- 3, 5
- 11, 13
- 29, 31
The numbers in each pair differ by two.
Input
First line of input consists of T (number of test cases).
Next T lines contains a single number N (indicating the Nth pair of twin primes).
T <= 25, 1 <= N <= 10^5
Output
For every test case output the pair of twin primes in each line separated by a single space.
Example
Input: 3 1 7 11 Output: 3 5 59 61 137 139
(Another tutorial version, with limited source code length, at TWINP2.)
hide comments
jack(chakradarraju):
2012-04-11 05:19:47
Sieve is not enough for this problem
|
Added by: | Avinash |
Date: | 2012-04-07 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own Problem |