// ACM-ICPC‘“à—\‘I2011 D. “S“¹æ‚èŒp‚¬ #include #include using namespace std; const int INF = 1000000007; static int cost[20][100][100]; int main(){ int n, m, c, s, g; while(cin >> n >> m >> c >> s >> g, n){ for(int i=0;i> x >> y >> d >> e; cost[e-1][x-1][y-1] = cost[e-1][y-1][x-1] = min(cost[e-1][y-1][x-1], d); } for(int l=0;l p(c); for(int i=0;i> p[i]; for(int i=0;i q(p[i]), r(p[i]); q[0] = 0; for(int j=1;j> q[j]; for(int j=0;j> r[j]; vector dist(q.back()+1); dist[0] = 0; for(int j=0;j+1