Problem Description
对于表达式n^2+n+41,当n在(x,y)范围内取整数值时(包括x,y)(-39<=x
import java.util.*;
class Main{
public static void main(String args[]){
Scanner sc =new Scanner(System.in);
while(sc.hasNext()){
int x = sc.nextInt();
int y = sc.nextInt();
// int z; double m;
int z=0; double m=1; int i =0;
if(x==0&&y==0){break;}
for(int n =x;n<=y;n++){
z=n*n+n+41;
for(int j=2;j<z/2;j++) {//判断是否为素数;
m=z%j; // m=0表示不是素数;
if(m==0){
i++;
//System.out.println(j+" "+m+" "+z);
}
}
}
if(i==0){
System.out.println("OK");
}
else{
System.out.println("Sorry");
}
}
}
}