#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>m>>k; using P = pair; vector > G(n); for(Int i=0;i>a>>b>>c; a--;b--; G[a].emplace_back(b,c); G[b].emplace_back(a,c); } vector d(k); for(Int i=0;i>d[i]; vector dp(n,1); for(Int i=0;i nx(n,0); for(Int v=0;v ans; for(Int i=0;i