#define _CRT_SECURE_NO_WARNINGS //#define _GLIBCXX_DEBUG #include using namespace std; typedef long long ll; //#define int ll //#define endl "\n" typedef vector vi; typedef vector vvi; typedef pair pii; #define all(c) (c).begin(), (c).end() #define loop(i,a,b) for(ll i=a; i ostream & operator<<(ostream & os, vector const &); template typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple const &){} template typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple const & t){ os << (n==0?"":" ") << get(t); _ot(os, t); } template ostream & operator<<(ostream & os, tuple const & t){ _ot<0>(os, t); return os; } template ostream & operator<<(ostream & os, pair const & p){ return os << "(" << p.first << ", " << p.second << ") "; } template ostream & operator<<(ostream & os, vector const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; } template inline bool chmax(T & x, T const & y){ return x inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; } #ifdef DEBUG #define dump(...) (cerr<<#__VA_ARGS__<<" = "<> x; return x; } int g(int n){ return (1+n)*n/2; } int f(int n){ if(n&1) return (n+1)/2 + f(n-1); else return g(n/2)*2; } int ask(int Y){ cout << "? " << Y << endl; int res; cin >> res; return res; } void repp(int Y){ cout << "! " << Y << endl; return; } int solve(){ if(ask(35) == -1){ int t = 0; while(ask(0)) t++; return t; } int l = 10, r = 1000000000; int t = 0; while(l+1 < r){ if(l==r) return l; int m = (l+r)/2; int x = ask(m-t); if(x==1) l = m+1; else if(x==-1) r = m; else if(x==0) return m; t++; } } int main(){ repp(solve()); }