#include using namespace std; #define MOD (long long int)(1e9+7) #define ll long long int #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=1; i<=(int)(n); i++) #define REP(i,n) for(int i=n-1; i>=0; i--) #define REPS(i,n) for(int i=n; i>0; i--) #define FOR(i,a,b) for(int i=a; i<(int)(b); i++) #define ALL(x) (x).begin(),(x).end() #define RALL(a) (a).rbegin(), (a).rend() #define CLR(a) memset((a), 0 ,sizeof(a)) #define PB push_back #define MP make_pair #define SP << " " << const int INF = 1001001001; const ll LINF = 100100100100100100; const double EPS = 1e-10; const long double PI = acos(-1.0L); typedef pair PII; typedef pair PLL; typedef pair PDD; typedef pair PDI; typedef vector VI; typedef vector VVI; typedef vector VL; #define chmax(a,b) a = (((a)<(b))?(b):(a)) #define chmin(a,b) a = (((a)>(b))?(b):(a)) __attribute__((constructor)) void initial(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } // queueを用いた場合の実装(経路復元無し) const int MAX_E = 200100; const int MAX_V = 200100; struct edge{int to; double cost;}; int V; vector G[MAX_V]; double d[MAX_V]; void dijkstra(int s){ // greaterを指定することでfirstが小さい順に取り出せるようにする priority_queue, greater > que; fill(d,d+V,(double)INF); d[s] = 0.0; que.push(MP(0.0,s)); while(!que.empty()){ PII p = que.top(); que.pop(); int v = p.second; if(d[v]d[v]+e.cost){ d[e.to] = d[v]+e.cost; que.push(PII(d[e.to], e.to)); } } } } signed main(){ int n,m; cin>>n>>m; V=n; int x,y; cin>>x>>y; x--; y--; vector t; rep(i,n){ double p,q; cin>>p>>q; t.PB(MP(p,q)); } rep(i,m){ int p,q; cin>>p>>q; p--; q--; double d=pow(pow(t[p].first-t[q].first,2.0)+pow(t[p].second-t[q].second,2.0),0.50); edge e1; e1.to=q; e1.cost=d; G[p].PB(e1); e1.to=p; G[q].PB(e1); } dijkstra(x); cout<