#include using namespace std; int main() { int l = 0, r = 1e9 + 9; while(r - l > 1) { int mid = (r+l)/2; cout << mid << endl; char c; cin >> c; if(c == 0) r = mid; else if(c == 1) l = mid; else return 0; } cout << l << endl; return 0; }