1087: USACO:回文质数

Memory Limit:0 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:177 Solved:47

Description

因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。

写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数;

Input

第 1 行: 二个整数 a 和 b .

Output

输出一个回文质数的列表,一行一个。

Sample Input Copy

5 500

Sample Output Copy

5
7
11
101
131
151
181
191
313
353
373
383

加入题单

算法标签: