#include #include #include #include #include #include #include #include #include #include #define ll long long using namespace std; struct e{ int to,cost; }; vector >es; vector costs; vector ans; int used[101][1001]; int ek; void dfs(int v,int k){ if(used[v][k] == 1)return; used[v][k] = 1; if(k == ek){ ans.push_back(v); return; } for(int i=0;i> n >> m >> ek; es.resize(n);costs.resize(ek); for(int i=0;i> a >> b >> c; a--;b--; es[a].push_back(e{b,c}); es[b].push_back(e{a,c}); } for(int i=0;i> costs[i]; } for(int i=0;i ret; int pre = -1; for(int i=0;i