#include #include using namespace std; constexpr int n = 200; int ask(const int x, const int y){ cout << x << ' ' << y << '\n'; cout.flush(); int rez; cin >> rez; return rez; } void solve(const int l, const int dr){ int st = 0, step = 1<<(int)log2(dr-st+1), x; for( ; step; step /= 2){ if(st + step >= dr){ continue; } x = ask(l, st+step); if(x == 0){ return; } if(x < 0){ st += step; } } solve(l+1, st+1); } int main(){ solve(0, n); return 0; }