#include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef pair T; typedef pair Ps; long long int INF = 2e18; const ll fact_table = 3200008; double Pi = 3.1415926535897932384626; priority_queue pql; priority_queue

pqp; priority_queue

bag; //big priority queue priority_queue ,greater > pqls; priority_queue ,greater > pqps; //small priority queue //top pop ll dx[8]={1,0,-1,0,1,1,-1,-1}; ll dy[8]={0,1,0,-1,1,-1,-1,1}; char dir[] = "DRUL"; //↓,→,↑,← #define endl "\n" #ifdef ENJAPMA #undef endl #endif #define p(x) cout<=1; i--){ rfact[i-1] = rfact[i] * i; rfact[i-1] %= mod; } return;} ll c3(ll n,ll r){ return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;} */ bool multicase = false; ll n,m,num,a,b,c,d,e,h,q; ll w, k, ans; long double x[500005], y[500005]; vector G[500005]; long double table[500005]; long double distance(ll a, ll b){ long double xa = x[a], xb = x[b], ya = y[a], yb = y[b]; return sqrt((xa-xb) * (xa-xb) + (ya-yb) * (ya-yb)); } void solve(){ cin >> n >> m; ll s, t; cin >> s >> t; for(ll i=1;i<=n;i++){ cin >> x[i] >> y[i]; } for(ll i=1;i<=m;i++){ cin >> a >> b; long double cost = distance(a, b); G[a].pb(Ps(cost, b)); G[b].pb(Ps(cost, a)); } for(ll i=1;i<=n;i++){ table[i] = 9999999999.99; } table[s] = 0.0; pqps.push(Ps(0.0, s)); while(!pqps.empty()){ Ps p = pqps.top(); pqps.pop(); ll v = p.second; long double nowcost = p.first; if(nowcost > table[v])continue; for(int i=0;i newcost){ table[nv] = newcost; pqps.push(Ps(newcost, nv)); } } } long double ans = table[t]; ps(ans); return; } int main(){ // init(); ios::sync_with_stdio(false); cin.tie(nullptr); ll q, testcase = 1; if(multicase){ cin >> q; }else{ q = 1; } while(q--){ // pu("Case ");pu("#");pu(testcase);pu(": "); solve(); testcase++; } // solve(); return 0; }