Problem list
Log in
#r03212 · Online Judge > GoldOJ

Primes in a Range

Silver III 2.0 s 1024 MB

Given $A$ and $B$, print every prime in $[A, B]$ in ascending order, one per line. If there are none, print empty.

Input

Two integers $A$ and $B$ ($1 \le A \le B \le 10^6$).

Output

Print the primes in $[A, B]$, or empty.

Example 1

Input
10 30
Output
11
13
17
19
23
29

Example 2

Input
24 28
Output
empty
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