P1217 [USACO1.5] Prime Palindromes

Description

The number $151$ is a prime palindrome because it is both a prime number and a palindrome. It is the same number when read forward as backward. Write a program that finds all prime palindromes in the range of two supplied numbers $a$ and $b$ ($5 \le a < b \le 100000000$). Both $a$ and $b$ are considered to be within the range.

Input Format

- Line 1: Two integers, $a$ and $b$.

Output Format

The list of palindromic primes in numerical order, one per line.

Explanation/Hint

### HINTS (use them carefully!) :::info[Hint 1] Generate the palindromes and see if they are prime. ::: :::info[Hint 2] Generate palindromes by combining digits properly. You might need more than one of the loops like below. ``` /* generate five digit palindrome: */ for (d1 = 1; d1