#include using namespace std; int main(){ cout << fixed << setprecision(5); int N, M; cin >> N >> M; int X, Y; cin >> X >> Y; X--; Y--; vector p(N), q(N); for (int i = 0; i < N; i++){ cin >> p[i] >> q[i]; } vector>> E(N); for (int i = 0; i < M; i++){ int P, Q; cin >> P >> Q; P--; Q--; double d = hypot(p[Q] - p[P], q[Q] - q[P]); E[P].push_back(make_pair(d, Q)); E[Q].push_back(make_pair(d, P)); } vector d(N, -1); priority_queue, vector>, greater>> pq; pq.push(make_pair(0, X)); while (!pq.empty()){ double c = pq.top().first; int v = pq.top().second; pq.pop(); if (d[v] == -1){ d[v] = c; for (auto P : E[v]){ int w = P.second; if (d[w] == -1){ pq.push(make_pair(c + P.first, w)); } } } } cout << d[Y] << endl; }