#include using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define mp(a,b) make_pair((a),(b)) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair pii; //template using vec=std::vector; const int INF=1<<30; const long long int LLNF_=1LL<<58; const double EPS=1e-9; const int dx[]={1,0,-1,0},dy[]={0,1,0,-1}; template ostream &operator<<(ostream &os, const vector &vec){ os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } void Solve(){ { int res; cout << "? " << 50 << endl; cin >> res; if(res==-1){ int k=1; while(true){ cout << "? " << 0 << endl; cin >> res; if(res==0){ cout << "! " << k << endl; return; } ++k; } } } int lb=10,ub=1000000001,k=1; while(true){ int mid=(lb+ub)/2,res; cout << "? " << mid << endl; cin >> res; if(res==0){ cout << "! " << mid+k << endl; break; }else if(res==-1) ub=mid; else lb=mid; --lb; --ub; if(lb<0) lb=0; if(ub<0) ub=0; ++k; } } int main(){ Solve(); return 0; }