HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Prime numbers

Section problems

• Set cover problem
• Subsets
• The N Queens Problem
• Maximum Sum 2
• Gifts of Santa Claus
• Shopping
• Diameter of graph
• Corridor
• Prime numbers
• Rectangles on a plane
• A. Бактерии
• A. Любимые числа
• A. Рекламный щит
• ASCII Characters
• Area of triangle
• B. basketball
• B. chaotic

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