#include using namespace std; #define all(v) v.begin(),v.end() using ll = long long; using ull = unsigned long long; using vll=vector; using vvll = vector>; using P = pair; using vp=vector>; const ll INF=1ll<<60; ll mod10=1e9+7; ll mod99=998244353; const double PI = acos(-1); #define rep(i,n) for (ll i=0;i=0;--i) #define rep2(i,a,n) for (ll i=a;i=n;--i) int main(){ ll N,K; cin>>N>>K; ll sx,sy,gx,gy; cin>>sx>>sy>>gx>>gy; vll X(N+2),Y(N+2); X[0]=sx,Y[0]=sy,X[N+1]=gx,Y[N+1]=gy; rep(i,N)cin>>X[i+1]>>Y[i+1]; ll l=0,r=1e6; while(r-l>1){ ll m=(r+l)/2; priority_queue> pq; vll dist(N+2,INF); dist[0]=0; pq.emplace(0,0); while(pq.size()){ auto [co,now]=pq.top();pq.pop(); if(dist[now]