#include using namespace std; int main(){ int left = 0, right = 1e9+1, mid, res; cout << right << endl; while(left + 1 < right){ int mid = (left+right)/2; cout << "? " << mid << flush; cin >> res; if(res == 1) left = mid; else if(res == 0) right = mid; } cout << left << endl; return 0; }