#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define PI acos(-1.0) #define FOR(I,A,B) for(int I = (A); I < (B); ++I) int main(){ int X = 50000, Y = 50000; int l = 0, r = 100000; int ld, rd, dd, cen; cout << l << Y << endl; cin >> ld; cout << r << Y << endl; cin >> rd; FOR(i,0,80){ if(ld > rd){ l = (l + r) / 2; cout << l << Y << endl; cin >> ld; } else if(ld < rd){ r = (l + r) / 2; cout << r << Y << endl; cin >> ld; } if(ld == rd){ cen = (l + r) / 2; cout << cen << Y << endl; cin >> dd; if(dd==0) return 0; } } int d; cout << cen << Y+dd << endl; cin >> d; if(d == 0) return 0; cout << cen << Y-dd << endl; cin >> d; if(d == 0) return 0; return 0; }