#include using namespace std; using ll = long long; int main(){ int n; cin>>n; vector > c(n,vector(n,(ll)1e9)); vector s(n); for(int i = 0;i>s[i]; int m; cin>>m; for(int i = 0;i>u>>v>>cost; c[u][v] = cost; c[v][u] = cost; } for(int k = 0;k