cho.sh
Notes
Loading...

Find Prime Numbers

Time limit

2s

Memory limit

256 MB

Problem

Given two natural numbers M and N, write a program that prints every prime number from M through N in increasing order.

Input

The first line contains the natural numbers M and N separated by a space.

  • 1 ≤ M ≤ N ≤ 1,000,000
  • The input always contains at least one prime number in the inclusive range [M, N].

Output

Print the prime numbers from M through N in increasing order, one per line.