#include using namespace std; int main(){ int N; cin >> N; vector p; for(int i = 2; i <= N; i++){ int siz = p.size(); bool is_prime = true; for(int j = 0; j < siz; j++){ if(i % p[j] == 0) is_prime = false; } if(is_prime) p.emplace_back(i); } int p_siz = p.size(); random_device rnd; mt19937 mt(rnd()); uniform_int_distribution<> prime(0, p_siz - 1); int ans = 1; int turn = 0; while(turn < 600){ int d = prime(mt); if(ans * p[d] > N) continue; turn++; cout << "? " << ans * p[d] << endl; int g; cin >> g; ans = g; if(ans > N / 2){ cout << "! " << ans << endl; return 0; } } cout << "! " << ans << endl; return 0; }