// yukicoder: No.513 宝探し2 // 2019.7.16 bal4u #include #include #define MAX 100000 int ask(int x, int y) { int d; printf("%d %d\n", x, y), fflush(stdout); scanf("%d", &d); if (d == 0) exit(0); return d; } int main() { int x, y, dl, dr; dl = ask(0,0), dr = ask(MAX, 0); if (dl == dr) x = MAX/2; if (dl > dr) x = ((dl-dr) + MAX) / 2; else x = (MAX-(dr-dl)) / 2; dl = ask(x, 0), dr = ask(x, MAX); if (dl == dr) y = MAX/2; if (dl > dr) y = ((dl-dr) + MAX) / 2; else y = (MAX-(dr-dl)) / 2; ask(x, y); return 0; }