Problem list
Log in
#r03102 · Online Judge > GoldOJ

Twin Primes

Silver IV 2.0 s 256 MB

A twin prime pair is $(p, p+2)$ where both are prime. Given $a$ and $b$, print every twin prime pair with both members in $[a, b]$, one pair per line p p+2, in increasing order of $p$. Print nothing if there are none.

Input

One line: $a$ and $b$ ($2 \le a \le b \le 4000000$).

Output

Print each twin prime pair, one per line.

Example 1

Input
2 20
Output
3 5
5 7
11 13
17 19
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code