#include using namespace std; using ll=long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N,K,M,P; cin>>N>>K>>M>>P; vector>G(N); for(int i=0;i>A>>B; --A,--B; G[A].push_back(B); G[B].push_back(A); } vectorS(N); for(int &i:S)cin>>i; vectordist(N,(int)1e9),v_cnt(N,0); priority_queue,vector>,greater>>pq; for(int i=0;i>T; --T; dist[T]=0; pq.push({0,0,T}); } while(pq.size()){ int d=pq.top()[0],t=pq.top()[1],v=pq.top()[2]; pq.pop(); if(v_cnt[v]>=2)continue; if(t==0){ if(ddist[v])continue; pq.push({d+S[v],1,v}); }else if(t==1){ if(d>dist[v]+S[v])continue; for(int i:G[v]){ if(dist[i]+P>d){ pq.push({d,0,i}); if(dist[i]>d){ dist[i]=d; } } } } } int ans=0; for(int i:v_cnt){ if(i>=2)ans+=1; } cout<