#include #define oo 2100000000 using namespace std; inline int read(){ int x=0,f=1;char cc=getchar(); while(cc<'0' || cc>'9') {if(cc=='-') f=-1;cc=getchar();} while(cc>='0' && cc<='9') {x=x*10+cc-'0';cc=getchar();} return x*f; } int n,m,x[410],y[410],xa,xb,ya,yb; int x_[410],y_[410],xa_,xb_,ya_,yb_; int sx[410],sy[410],gx[410],gy[410]; int numx,numy,tx[410][410],ty[410][410]; int con[200010],t[800010],nxt[800010],vis[200010]; double w[800010],dis[200010]; inline bool cmp1(int i,int j){ return x[i] > q; q.push(pair(0,(xa_-1)*numy+ya_)); while(!q.empty()){ int x=q.top().second;q.pop(); if(vis[x]) continue;vis[x]=1; for(int p=con[x];p;p=nxt[p])if(dis[x]+w[p]+1e-8(-dis[t[p]],t[p])); } } printf("%.5f\n",dis[(xb_-1)*numy+yb_]); } }