#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000000.0 double eps = 1e-7; int main(){ int N,M,K,X,Y; cin>>N>>M>>K>>X>>Y; X--;Y--; vector x(N),y(N); for(int i=0;i>x[i]>>y[i]; vector>> E(N,vector>()); for(int i=0;i>u>>v; u--;v--; double d = sqrt(pow(x[u]-x[v],2.0)+pow(y[u]-y[v],2.0)); E[u].emplace_back(v,d); E[v].emplace_back(u,d); } vector ans; vector cnt(N,0); priority_queue,vector>,vector,vector>>,greater,vector>>> Q; { vector t(N,false); t[X] = true; Q.emplace(make_pair(0.0,X),t); } while(Q.size()!=0){ double D1 = Q.top().first.first; int from = Q.top().first.second; vector b = Q.top().second; Q.pop(); if(cnt[from]>=K)continue; cnt[from]++; if(from==Y)ans.push_back(D1); for(int i=0;i=K)continue; if(b[to])continue; double D2 = E[from][i].second; vector t = b; t[to] = true; Q.emplace(make_pair(D1+D2,to),t); } //cout<=ans.size())cout<<-1<