// clang-format off #include #define int long long int #define main signed main() #define bye return 0 #define loop(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) loop(i, 0, n) #define each(p, v) for (auto p = (v).begin(); p != (v).end(); p++) #define all(v) (v).begin(), (v).end() #define prec(n) fixed << setprecision(n) #define dump(x) cerr << "(L" << __LINE__ << ") " << #x << " = " << (x) << endl #define clr(x, a) memset(x, a, sizeof(x)) #define sum(v) accumulate(all(v), 0) #define stlice(from, to) substr(from, (to) - (from) + 1) #define odd(n) ((n) % 2) #define even(n) (!odd(n)) #define INF 1000000000 #define MOD 1000000007 #define pb push_back #define mp make_pair #define mt make_tuple #define fi first #define se second #define vi vector #define vb vector #define vc vector using namespace std; // clang-format on main { int x1 = 0, x2 = 100000, y1 = 0, y2 = 100000; int x; while (true) { int t, s; cout << x1 << ' ' << 0 << endl; cin >> t; cout << x2 << ' ' << 0 << endl; cin >> s; if (t == s) { x = x1 + (x2 - x1) / 2; break; } if (t < s) { x2 = x1 + (x2 - x1 + 1) / 2; continue; } if (t > s) { x1 = x1 + (x2 - x1) / 2; continue; } } int y; while (true) { int t, s; cout << 0 << ' ' << y1 << endl; cin >> t; cout << 0 << ' ' << y2 << endl; cin >> s; if (t == s) { y = y1 + (y2 - y1) / 2; break; } if (t < s) { y2 = y1 + (y2 - y1 + 1) / 2; continue; } if (t > s) { y1 = y1 + (y2 - y1) / 2; continue; } } cout << x << ' ' << y << endl; bye; }