#include #include #include int main(){ long a,b,i,j,*r; long result = 0; scanf("%ld %ld",&a,&b); r=(long*)malloc(sizeof(long)*(b-a+1)); for(i=a;i<=b;i++){ r[i-a]=0; for(j=2;j<=sqrt(i);j++){ if(i%j==0){ r[i-a]=j; break; } } } j=0; for(i=a;i<=b;i++){ if(r[i-a]>=j){ j=r[i-a]; result = i; } } printf("%ld\n",result); return 0; }