#include #include #include #include using namespace std; vector G[210]; int cost[210][210]; int n; const int inf=1e9; string dijkstra(int s, int g) { vector d(n, inf); vector p(n, -1u); priority_queue> q; d[g]=0; q.emplace(0, g); while (q.size()) { int c, v; tie(c, v)=q.top(); q.pop(); if (d[v]<-c) continue; for(int w: G[v]) { if (d[w]>d[v]+cost[v][w] or d[w]==d[v]+cost[v][w] and p[w]>v) { d[w]=d[v]+cost[v][w]; q.emplace(-d[w], w); p[w]=v; } } } string res; while (s!=g) { res+=to_string(s)+' '; s=p[s]; } res+=to_string(g); return res; } int main() { int m, s, g; while (cin>>n>>m>>s>>g) { for(int i=0;i>a>>b>>c; G[a].push_back(b); G[b].push_back(a); cost[a][b]=cost[b][a]=c; } cout<