#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; class LengthOfCandle { public: int ask(int Y){ cout << "? " << Y << endl; int res; cin >> res; return res; } void solve(void) { ll u = 1E+9; ll l = 10; REP(t,100) { // X = Y + t ll mid = (l+u)/2; int res = ask(mid-t); if ( res == 0 ) { u = mid; break; } if ( res > 0 ) l = mid+t; else u = mid+t; if (u == l) break; } cout<<"! "<solve(); delete obj; return 0; } #endif