#include using namespace std; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return 1; } return 0; } void print() { cout << "\n"; } template void print(const T &x) { cout << x << "\n"; } template void print(const T &x, const Args &... args) { cout << x << " "; print(args...); } template void printVector(const vector &v) { for(const T &x : v) { cout << x << " "; } cout << "\n"; } using ll = long long; #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() const double EPS = 1e-7; const int INF = 1 << 30; const ll LLINF = 1LL << 60; const double PI = acos(-1); constexpr int MOD = 1000000007; const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; //------------------------------------- using ld = long double; using P = complex; using Data = pair; struct edge { int to; ld cost; }; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int n, m, X, Y; cin >> n >> m >> X >> Y; X--; Y--; vector

p(n); for(int i = 0; i < n; i++) { ld x, y; cin >> x >> y; p[i] = P(x, y); } vector> g(n); for(int i = 0; i < m; i++) { int a, b; cin >> a >> b; a--; b--; g[a].emplace_back(edge{b, abs(p[a] - p[b])}); g[b].emplace_back(edge{a, abs(p[a] - p[b])}); } priority_queue, greater> que; vector d(n, LLINF); d[X] = 0; que.push(Data(0, X)); while(que.size()) { auto [nd, nv] = que.top(); que.pop(); if(nd > d[nv]) { continue; } for(const auto &e : g[nv]) { if(d[e.to] > nd + e.cost) { d[e.to] = nd + e.cost; que.push(Data(d[e.to], e.to)); } } } print(d[Y]); }