UVa10394 - Twin Primes

作業上傳:http://203.68.236.9/problem/b0025

出處UVa10394(https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1335)

中文翻譯(https://zerojudge.tw/ShowProblem?problemid=d362)


如果 p 為質數,且 p+2 也是質數,則我們說 (p,p+2) 是一對 twin prime

一開始的一些 twin primes 是 (3,5), (5,7), (11,13), (17,19), (29,31), (41,43)

這個問題是要請你找出第 S 對 twin prime

輸入說明

每組測試資料一列

每列有 1 個整數 S(1 <= S <= 100000)

輸出說明

每組測試資料輸出第S對twin prime

以 (p1,<spece>p2) 的格式 (在這裡<space>代表空白字元)

你可以放心的假設在第 100000 對 twin prime 中的質數比 20000000 小

範例輸入

1

2

3

4

範例輸出

(3, 5)

(5, 7)

(11, 13)

(17, 19)