#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a> g; vector d,prev; graph(ll n){ v=n; g.resize(v); d.resize(v,INF); prev.resize(v,-1); } void add_edge(ll s,ll t,ll cost){ g[s].push_back({t,cost}); } void dijkstra(ll s){ rep(i,d.size()){ d[i]=INF; } priority_queue,greater> pq; d[s]=0; pq.push({0,s}); while(!pq.empty()){ ll x_dist,x_vertex; tie(x_dist,x_vertex)=pq.top(); pq.pop(); if(d[x_vertex]> n >> k; ll sx,sy,gx,gy; cin >> sx >> sy >> gx >> gy; vector x(n),y(n); rep(i,n) cin >> x[i] >> y[i]; x.push_back(sx); y.push_back(sy); x.push_back(gx); y.push_back(gy); ll ok=2e5,ng=-1; while(1