#pragma GCC optimize("Ofast") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int ll; typedef unsigned long long ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } struct UnionFind{ vector par,num; UnionFind(int n):par(n),num(n,1){ iota(par.begin(),par.end(),0); //include } int find(int v){ return (par[v]==v)?v:(par[v]=find(par[v])); } void unite(int u,int v){ u=find(u),v=find(v); if(u==v)return; if(num[u]> n >> m >> k; vector a(n); vector> d(n,vector(n,1LL<<60)); for(int i=0;i> a[i]; d[i][i] = 0; } for(int i=0;i> x >> y >> z; x--; y--; d[x][y] = d[y][x] = z; } for(int k=0;k>> v; for(int i=0;i<(1<