#include using namespace std; long long int dist[101]; vector > adj[101]; const long long int INF = 1e18; int main(void) { cin.tie(0); ios::sync_with_stdio(false); int n,m; long long int a,b,c; cin >> n >> m; for(int i=0;i> a >> b >> c; a-=1; b-=1; adj[a].push_back(make_pair(b,c)); } for(int i=0;i dist[k] + cost) { dist[next] = dist[k] + cost; } } } } for(int j=0;j