#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M,C; cin >> N >> M >> C; vector>> Graph(N); for(int i=0; i> u >> v; u--; v--; int r,w; cin >> r >> w; Graph.at(u).push_back({v,r,w}); Graph.at(v).push_back({u,r,w}); } for(int i=1; i<=C; i++){ vector dist(N,-1); dist.at(0) = i; priority_queue> Q; Q.push({dist.at(0),0}); while(Q.size()){ auto [nowc,pos] = Q.top(); Q.pop(); for(auto [to,r,w] : Graph.at(pos)){ int cost = nowc/r+w; if(dist.at(to) < nowc-cost){ dist.at(to) = nowc-cost; Q.push({dist.at(to),to}); } } } cout << dist.at(N-1) << "\n"; } }