#pragma GCC optimize ("O3") #pragma GCC target ("avx2") #include using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (n); i++) #define rep1(i, n) for(int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_back #define mp make_pair #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define Would #define you #define please #define PT pair int main() { cin.tie(0); ios::sync_with_stdio(false); int N, M, X, Y; cin >> N >> M >> X >> Y; int P[200001], Q[200001]; rep1(i, N) { cin >> P[i] >> Q[i]; } vector E[200001]; rep1(i, M) { int p, q; cin >> p >> q; int x = (P[p] - P[q]); int y = (Q[p] - Q[q]); double d = sqrt(x * x + y * y); E[p].pb({ d, q }); E[q].pb({ d, p }); } double D[200001]; rep1(i, N) D[i] = 1e18; D[X] = 0; priority_queue, greater> que; que.push(mp(0, X)); while (que.size()) { PT p = que.top(); que.pop(); int i = p.second; if (D[i] != p.first) continue; for (PT p2 : E[i]) { int j = p2.second; double d = D[i] + p2.first; if (D[j] > d) { D[j] = d; que.push(mp(d, j)); } } } cout << setprecision(12) << D[Y] << endl; Would you please return 0; }