#include using namespace std; int query(int a, int b) { cout << a << " " << b << endl; cin >> a; return a; } int main() { #ifndef ONLINE_JUDGE freopen("debug", "r", stdin); #endif // ONLINE_JUDGE int qa = -1, di; int N = 200; int i, soli = 0; for(i=1; i>=1; i; i>>=1) { if(soli + i < N) { int a = query(soli + i, soli + i); if(a == 0) return 0; if(a < 0) soli += i; } } int solj = soli; for(i=1; i>=1; i; i>>=1) { if(i + solj < N) { int a = query(soli, i + solj); if(a == 0) return 0; if(a < 0) solj += i; } } solj = soli; for(i=1; i>=1; i; i>>=1) { if(i + solj < N) { int a = query(solj + i, soli); if(a == 0) return 0; if(a < 0) solj += i; } } return 0; }