#include #define rep(i,n) for (int i = 0; i < (n); i ++) using namespace std; typedef long long ll; typedef pair PL; typedef pair P; const int INF = 1e9; const ll MOD = 1e12; const double eps = 1e-6; vector dijkstra(int n, vector>& G,int& s) { vector dist(n,(double)INF); dist[s] = 0.0; priority_queue,greater

> q; q.push({0.0,s}); while (!q.empty()) { PL p = q.top(); q.pop(); double d = p.first; int v = p.second; if (dist[v] < d) continue; for (PL p: G[v]) { double cost = p.first; int e = p.second; if (dist[e] > dist[v] + cost) { dist[e] = dist[v] + cost; q.push({dist[e],e}); } } } return dist; } int main() { int N,M,X,Y; cin >> N >> M >> X >> Y; X--;Y--; vector> point(N); rep(i,N) cin >> point[i].first >> point[i].second; vector> G(N); auto dist = [&](int x,int y){return sqrt((point[x].first - point[y].first) * (point[x].first - point[y].first) + (point[x].second - point[y].second) * (point[x].second - point[y].second));}; rep(_,M){ int p,q; cin >> p >> q; p --; q --; double d = dist(p,q); G[p].push_back(PL(d,q)); G[q].push_back(PL(d,p)); } vector distance = dijkstra(N,G,X); double ans = distance[Y]; printf("%0.10f\n",ans); }