HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Prime numbers

Section problems

• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection
• Diameter of graph
• Divisors count
• GCD of ones
• Prime numbers
• Set cover problem
• Shopping
• Corridor
• D. Love-Hate
• Ferris Wheel
• Repetitions
• Weird Algorithm
• Bit Strings

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 800/800/800/800 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

Given two natural numbers M and N. Find all prime numbers between them.

Input

There are two integers M and N on the first line (0 < M, N ≤ 1000000).

Output

Write all prime numbers between M and N in increasing order.

Example

stdin stdout

1 5

2 3 5

Для отправки решений необходимо выполнить вход.

www.contester.ru