#include #include #include using namespace std; using ll = long long; #include #include int c; map,ll> memo; ll nx = 10; ll ny = 10; ll ask(ll x,ll y){ // ll d = abs(x-nx) + abs(y-ny); // if(d==0) { // cout<100){ assert(false); } cout<>d; if(d==0){ exit(0); } return memo[{x,y}] = d; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll left = 0; ll right = 100000; int cnt = 0; ll n1,n2; while(right-left>2){ //cout<2){ ll m1 = (21*left+13*right) / 34; ll m2 = (21*right+13*left) / 34; // if(cnt==1) m1 = n1; // if(cnt==2) m2 = n2; n1 = m1; n2 = m2; ll d1 = ask(x,m1); ll d2 = ask(x,m2); if(d1<=d2){ right = m2; cnt = 1; }else{ left = m1; cnt = 2; } } for(ll y = left;y<=right;y++){ ll d = ask(x,y); } }