#include #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) for(int i = 0; i < (b); i++) #define all(a) (a).begin(), (a).end() #define show(x) cerr << #x << " = " << (x) << endl; using namespace std; const int MAX = 100000; const int dy[16] = { 1,-1, 1,-1, 0,-2, 0, 2}; const int dx[16] = { 1, 1,-1,-1, 2, 0,-2, 0}; int main(){ int x, y; int x_right = MAX, x_left = 0; int y_right = MAX, y_left = 0; rep(i,20){ x = (x_right + x_left) / 2; y = (y_right + y_left) / 2; cout << x << ' ' << y << endl; int d; cin >> d; if(d == 0){ cout << x << ' ' << y << endl; return 0; } int mini = MAX * 3; int p; rep(j,4){ cout << x + dx[j] * d / 2 << ' ' << y + dy[j] * d / 2 << endl; int tmp; cin >> tmp; if(tmp == 0){ cout << x + dx[j] * max(1,d / 2) << ' ' << y + dy[j] * max(1,d / 2)<< endl; return 0; } if(mini > tmp){ mini = tmp; p = j; } } switch (p) { case 0: x_left = x; y_left = y; break; case 1: x_left = x; y_right = y; break; case 2: x_right = x; y_left = y; break; case 3: x_right = x; y_right = y; break; } } cout << x << ' ' << y << endl; }