#include using namespace std; #define MOD (long long int)(998244353) #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); } struct State { int n; double w; State(int n, double w) : n(n), w(w) {} bool operator < (const State &s) const { return w > s.w; } }; struct Edge { int n; double w; Edge (int n, double w) : n(n), w(w) {} }; typedef vector Edges; typedef vector Graph; vector ans; int k_shortestPath(const Graph &g, int s, int e, int k) { int N = g.size(); double dist[N]; bool visited[N]; for (int i = 0; i <= N; ++i) dist[i] = (double)LINF; dist[e] = 0.0; memset(visited, false, sizeof(visited)); priority_queue Q; Q.push(State(e, 0.0)); while (!Q.empty()) { State cr = Q.top(); Q.pop(); if (visited[cr.n]) continue; visited[cr.n] = true; for (int i = 0; i < g[cr.n].size(); ++i) { Edge edg = g[cr.n][i]; if (visited[edg.n]) continue; if (dist[edg.n] > cr.w + edg.w) { dist[edg.n] = cr.w + edg.w; Q.push(State(edg.n, cr.w + edg.w)); } } } // cerr< R; /* priority_queue Rは * [それまでの距離+そのノードからゴールまでの距離] * でソートされる。 * これによりゴールに近い状態から取り出される */ R.push(State(s, 0.0 + dist[s])); while (!R.empty()) { State cr = R.top(); R.pop(); cr.w -= dist[cr.n]; // cr.wをそれまでの距離に戻す // cerr<< cr.w SP cnt<1&&R.size()==1) return -1; } return -1; } int main() { int n,m,k; cin>>n>>m>>k; Graph g(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); g[p].PB(Edge(q,d)); g[q].PB(Edge(p,d)); } int ret=k_shortestPath(g, x, y, k); rep(i,ans.size()) cout<