#include #include using namespace std; struct SieveEratos{ vector t; SieveEratos(int n):t(n+1,true){ t[0] = t[1] = 1; for(int i = 2; n >= i; i++){ if(t[i]){ for(int j = i+i; n >= j; j+=i){ t[j] = 0; } } } } bool operator[](int x){return t[x];} }; int main(){ int n;cin>>n; SieveEratos SE(n); vector p; for(int i = 2; n >= i; i++){ if(SE[i])p.push_back(i); } int ans = 1; for(int i = 0; p.size() > i; i++){ int nw = 1; while(n >= p[i]*nw){ nw *= p[i]; } cout << "? " << nw << endl; int t; cin>>t; if(t == -1){ cout << 1/0 << endl; } ans *= t; } cout << ans << endl; }