#t127. 绝对素数
绝对素数
Absolute Prime
Problem Description
If a two-digit number is prime, and remains prime after swapping its two digits, it is called an absolute prime, for example . Given two positive integers , find all absolute primes that are greater than or equal to and less than or equal to .
Input Format
The input is line containing two positive integers and . It is guaranteed that .
Output Format
Several lines, each containing one absolute prime, output in ascending order.
Sample Input
11 20
Sample Output
11
13
17
Sample Explanation
For the input , , the two-digit numbers in the range are . Among them the primes are . Check whether each is an absolute prime:
- is prime, and reversed it is still (prime), so is an absolute prime.
- is prime, and reversed it is (prime), so is an absolute prime.
- is prime, and reversed it is (prime), so is an absolute prime.
- is prime, and reversed it is , but is not prime, so is not an absolute prime.
Therefore the final output is .
Constraints
, i.e. all numbers involved are two-digit numbers. It is guaranteed that and the primes sought are all within .