#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int h(int n){ if(n == 0)return 0; if(n % 9 == 0)return 9; return n % 9; } bool isp[200010]; vector getPrimes(int K, int N){ for(int i=0;i<=N;i++)isp[i] = true; isp[0] = isp[1] = false; for(int p=2;p*p<=N;p++)if(isp[p]){ for(int k=p*p;k<=N;k+=p)isp[k] = false; } vector res; for(int i=K;i<=N;i++)if(isp[i])res.push_back(i); return res; } int main() { int K, N; cin >> K >> N; vector primes = getPrimes(K, N); int maxi = 0; int res = 0; for(int i=0;i used; int cnt = 0; for(int j=i;j= maxi){ maxi = cnt; res = primes[i]; } } cout << res << endl; return 0; }