#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define eps 0.000000001 #define LONG_INF 10000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) int judged[1000][1000] = {}; int judge(int a, int b) { if (judged[a][b] != 0) return judged[a][b] - 1; cout << a << " " << b << endl; int hoge; cin >> hoge; return judged[a][b] = hoge+1; } int main() { int x = 0; int x_top = 100000,x_bot = 0; while (x_top - x_bot > 2) { int left= (double)(x_top - x_bot) / (GOLD + 1.0) + x_bot; int right = (double)(x_top - x_bot) / GOLD + x_bot; if (judge(0,left) > judge(0,right)) { x_bot = left; } else { x_top = right; } } if (judge(0, x_bot) < judge(0, x_bot + 1)) { x = x_bot; } else { if (judge(0, x_bot + 1) < judge(0, x_bot + 2)) { x = x_bot + 1; } else { x = x_bot + 2; } } int y_top = 100000, y_bot = 0; while (y_top - y_bot > 2) { int left = (y_bot + y_bot + y_top) / 3; int right = (y_top + y_top + y_bot) / 3; if (judge(left,x) > judge(right,x)) { y_bot = left; } else { y_top = right; } } for (int i = 0;i < 3;++i) { judge(y_bot + i, x); } return 0; }