1 #include<cstdio> 2 int a[100000+11]={1,1}; 3 int main() 4 { 5 for(int i=2;i<100000;i++) 6 { 7 if(a[i] == 1) continue; 8 for(int j=i*2;j<100000;j+=i) 9 { 10 a[j]=1; 11 } 12 } 13 int x,y,k; 14 while(scanf("%d%d",&x,&y)&&(x+y)) 15 { 16 k=0; 17 for(int i=x;i<=y;i++) 18 { 19 if(a[i*i+i+41] == 1) 20 { 21 printf("Sorry\n"); 22 k=1; 23 break; 24 } 25 } 26 if(k == 0) 27 printf("OK\n"); 28 } 29 30 }
时间: 2024-11-19 15:48:13