#include #include using namespace std; int main() { int l = 1, r = 1e9, m = (l + r)/2; while(true) { int res; cout << "? "<< m << endl; cin >> res; if(res) { l = m; } else { r = m - 1; } if(l == r) break; m = (l + r) / 2 + 1; } cout << "! " << l << endl; }