#include using namespace std; using ll=long long; using vl=vector; #define print(a) cout<(b);i--) #define all(v) v.begin(),v.end() #define dall(v) v.rbegin(),v.rend() #define pqmaxl priority_queue #define pqminl priority_queue,greater> //ほんへ int main(){ //呪い ios::sync_with_stdio(false); cin.tie(nullptr); //やれ ll n,m,k,u,v; cin>>n>>m>>k; vl c(m); rep(i,0,m)cin>>c[i]; vector>>edge(n); rep(i,0,m){ cin>>u>>v; edge[u-1].push_back({v-1,c[i]}); edge[v-1].push_back({u-1,c[i]}); } priority_queue,vector>,greater>>st; vectornow(n,vl(k+1,1e18)); st.push({0,0,0}); now[0]=vl(k+1,0); while(!st.empty()){ auto it=st.top(); st.pop(); ll cos=get<0>(it),pot=get<1>(it),used=get<2>(it); for(auto p:edge[pot]){ if(cos>now[pot][used])continue; if(cos+p.second