#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int query(int x) { cout << "? " << x << endl; cout.flush(); int ret; cin >> ret; return ret; } void answer(int x) { cout << "! " << x << endl; cout.flush(); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int lo = 1; int hi = 1e9+1; while (hi - lo > 1) { int mi = (lo + hi) / 2; if (query(mi)) lo = mi; else hi = mi; } answer(lo); return 0; }