Generate all primes between two numbers
Given two numbers a and b, you are asked to generate all the prime numbers between a and b (inclusive).
Input
The first line of the input contains two integers a and b (1 ≤ a ≤ b ≤ ).
Output
The program should print all the prime numbers between a and b (inclusive).
Examples
Input | Output |
|---|---|
1 7 | 2 3 5 7 |
12 17 | 13 17 |
8 9 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB