#include #include using namespace std; using ui=unsigned int; struct edge_t { int cost, to; }; struct node_t { ui rest; vector edge; }; int main(void) { vector node; int n, m, i, is_changed; while(scanf("%d%d", &n, &m)==2) { node.clear(); node.resize(n+1); for(i=0;i