#include using namespace std; typedef long long ll; typedef long double ld; #define rep(i,n) for (int i = 0; i < (n); ++i) templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b>> g(nmax); ld d[nmax]; void dijkstra(ll s){ priority_queue,vector>,greater>> pq; fill(d,d+nmax,inf); d[s]=0; pq.push(make_pair(0,s)); while(!pq.empty()){ pair p=pq.top(); pq.pop(); ll v=p.second; if(d[v]d[v]+x.second){ d[x.first]=d[v]+x.second; pq.push(make_pair(d[x.first],x.first)); } } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n,m;cin >> n >> m; int x,y;cin >> x >> y; x--,y--; vector p(n),q(n); rep(i,n){ cin >> p[i] >> q[i]; } rep(i,m){ int u,v;cin >> u >> v; u--,v--; double dis=sqrt((p[u]-p[v])*(p[u]-p[v])+(q[u]-q[v])*(q[u]-q[v])); g[u].push_back({v,dis}); g[v].push_back({u,dis}); } dijkstra(x); cout << fixed << setprecision(10) << d[y] << endl; }