#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int ok = 0, ng = 1 << 30; while(ok + 1 < ng){ int mid = (ok + ng) / 2; int res; cout << mid << endl; cin >> res; (res == 1 ? ok : ng) = mid; } cout << ok << endl; }