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