#include using namespace std; using PP = int; struct Point{ public: PP x,y; Point() : x(0),y(0) {} Point(PP a,PP b) : x(a),y(b) {} Point &operator=(const Point &b) = default; Point operator+(const Point &b)const{return Point(x+b.x,y+b.y);} Point operator-(const Point &b)const{return Point(x-b.x,y-b.y);} Point operator*(const PP &b)const{return Point(x*b,y*b);} Point operator/(const PP &b)const{return Point(x/b,y/b);} Point &operator+=(const Point &b){return *this=*this+b;} Point &operator-=(const Point &b){return *this=*this-b;} Point &operator*=(const PP &b){return *this=*this*b;} Point &operator/=(const PP &b){return *this=*this/b;} friend bool operator<(const Point &a,const Point &b){ if(a.x == b.x) return a.y < b.y; else return a.x < b.x; } friend bool operator<=(const Point &a,const Point &b){ if(a.x == b.x) return a.y <= b.y; else return a.x < b.x; } friend bool operator==(const Point &a,const Point &b){return a.x==b.x && a.y==b.y;} friend bool operator>=(const Point &a,const Point &b){return !(a < b);} friend bool operator>(const Point &a,const Point &b){return !(a <= b);} friend bool operator!=(const Point &a,const Point &b){return a.x!=b.x || a.y!=b.y;} friend PP inner(const Point a,const Point b){return a.x*b.x+a.y*b.y;} friend PP cross(const Point a,const Point b){return a.x*b.y-a.y*b.x;} friend PP twodist(const Point a,const Point b){return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);}//2乗で返す. Point rot(double theta)const{return {PP(x*cos(theta)-y*sin(theta)),PP(x*sin(theta)+y*cos(theta))};} //PP=double限定. Point rot90()const{return {-y,x};} Point rot180()const{return {-x,-y};} Point rot270()const{return {y,-x};} friend istream &operator>>(istream &is,Point &a){ is >> a.x >> a.y; return is; } friend ostream &operator<<(ostream &os,const Point &a){ os << a.x << " " << a.y; return os; } }; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; Point a,b; cin >> a >> b; int low = 0,high = T+1; while(high-low > 1){ int mid = (high+low)/2; cout << "? " << mid << endl; Point c; cin >> c; int d = abs(a.x-c.x)+abs(a.y-c.y); swap(a,b); int d2 = abs(a.x-c.x)+abs(a.y-c.y); swap(a,b); if(d >= d2) low = mid; else high = mid; } cout << low << endl; }