#include using namespace std; using lnt = long long; using Real = long double; #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define REP(i, n) for(lnt i=0;i<(n);++i) #define RANGE(i, a, b) for(lnt i=(a);i<(b);++i) #define RREP(i, n) for(lnt i=(n)-1;i>= 0;--i) #define ln '\n' #define pb push_back #define eb emplace_back #define pque priority_queue #define umap unordered_map #define uset unordered_set #define dcout cout< inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;} template inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;} template inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} template inline T nHr(T a,T b){return nCr(a+b-1,b);} template inline bool chmax(T& a,T b){if(a inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} using pint = pair; using plnt = pair; using vint = vector; using vlnt = vector; constexpr lnt MOD = 1e9+7; struct edge {int to; Real cost;}; int main(){ summon_tourist; int N, M, X, Y; cin >> N >> M >> X >> Y; X--; Y--; vector p(N), q(N); vector> G(N); REP(i, N) cin >> p[i] >> q[i]; REP(i, M){ int u, v; cin >> u >> v; u--; v--; Real dis = sqrtl( powl(p[u]-p[v], 2) + powl(q[u]-q[v], 2) ); G[u].pb({v, dis}); G[v].pb({u, dis}); } using PA = pair; vector dist(N, 1e9); dist[X] = 0.0; pque, greater> que; que.push({0.0, X}); while(!que.empty()){ PA pa = que.top(); que.pop(); int pos = pa.second; if(dist[pos] < pa.first) continue; for(auto e: G[pos]){ if(dist[pos] + e.cost < dist[e.to]){ dist[e.to] = dist[pos] + e.cost; que.push({dist[e.to], e.to}); } } } dcout << dist[Y] << ln; }