1. 


/**
* Angewandte Mathematik SS 09
967 Circular http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=11&problem=908&mosmsg=Submission+received+with+ID+7087691

* UVa Status: Accepted
* Run Time: 0.350
* Programming Language: C
* Date: 23.04.2009
* @author Doina Logofatu logofatu@hm.edu
*/


/*
a -> array with all circular primes (42)
x, y -> input pair of numbers
i -> first position in array with a[i] >= x
j -> first position in array with a[j] > y

then the answer is (j-i) !!!
*/

#include <stdio.h>

int main() {

int x, y, i, j;

int a[42] = { 113, 131, 197, 199, 311, 337, 373, 719, 733, 919,
971, 991, 1193, 1931, 3119, 3779, 7793, 7937, 9311, 9377,
11939, 19391, 19937, 37199, 39119, 71993, 91193, 93719,93911, 99371,
193939,199933,319993,331999,391939,393919,919393,933199,939193,939391,
993319,999331

};

while(scanf("%d", &x)==1 && x!=-1 && scanf("%d", &y)==1){

for(i=0; i<42; i++)
if(a[i]>=x) break;

for(j=i; j<42; j++)
if(a[j]>y) break;

x = j-i;

if(x<1) { printf("No Circular Primes.\n"); continue; }
if(x==1) { printf("1 Circular Prime.\n"); continue; }
if(x>1) printf("%d Circular Primes.\n", x);

}

return 0;

}