UVa 10394 - Twin Primes

10394 - Twin Primes

 * http://acm.uva.es/problemset/v103/10394.html

Summary
This problem is a simple prime calculating problem. You have to find twin prim numbers. A pair of twin numbers e.g. is (3,5). Or in general (p, p+2)

Explanation
The time limit allows you to precalculate all primes between 2 and 20000000. Then you can look for all twin primes in that intervall. After that it is easy to find the n-th twin primes.

Input
1 2 3 4

Output
(3, 5) (5, 7) (11, 13) (17, 19)