#include #include #include using namespace std; using ll = long long; int main(){ ll l,r; l = 1; r = pow(10,9); char c; while(1){ ll mid = ceil((double)(l+r)/2); cout << '?' << ' ' << mid << endl; fflush(stdout); cin >> c; if(c == '1') l = mid; else r = mid-1; if(r - l == 1){ cout << '?' << ' ' << r << endl; fflush(stdout); cin >> c; if(c == '1') cout << '!' << ' ' << r << endl; else cout << '!' << ' ' << l << endl; return 0; } } }