#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; #define MOD 1000000007 // 10^9 + 7 #define INF 1000000000 // 10^9 #define LLINF 1LL<<60 int main() { cin.tie(0); ios::sync_with_stdio(false); int up = 100001; int bottom = 0; int left = 0; int right = 100001; int ld, rd; cout << left << " " << up << endl; cin >> ld; cout << right << " " << up << endl; cin >> rd; while (true) { if (ld == rd) { int tmp= (left + right) / 2; left = right = tmp; break; } else if (ld < rd) { right = (left + right) / 2; cout << right << " " << up << endl; cin >> rd; } else { // rd < ld left = (left + right) / 2 + 1; cout << left << " " << up << endl; cin >> ld; } } bool flag = false; int ud, bd; cout << left << " " << up << endl; cin >> ud; cout << left << " " << bottom << endl; cin >> bd; if (bd == 0) flag = true; while (!flag) { if (bd == ud) { cout << left << " " << (bottom + up) / 2 << endl; cin >> bd; ud = bd; flag = true; } else if (bd < ud) { up = (bottom + up) / 2; cout << left << " " << up << endl; cin >> ud; if (ud == 0) flag = true; } else { // ud < bd bottom = (bottom + up) / 2 + 1; cout << left << " " << bottom << endl; cin >> bd; if (bd == 0) flag = true; } } return 0; }