TWINP2 - 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 relaxed source code length, at TWINP.)
hide comments
Ishan:
2022-06-23 06:02:51
if TWINP and TWINP2 are both tutorials, which is the clasical one ? |
|
[Lakshman]:
2013-04-18 18:21:05
AC with exactly 512B...HaHa...Sieve is working fine.. Last edit: 2013-04-18 18:21:18 |
|
numerix:
2012-04-11 14:35:17
Interesting variant, but source limit must be stricter to be a real challenge. 1000 B should be enough. |
|
Francky:
2012-04-11 14:35:17
Nice variant, thanks for this edition.
|
Added by: | Avinash |
Date: | 2012-04-11 |
Time limit: | 1s |
Source limit: | 512B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own Problem |