#include #include #include using namespace std; using ll = long long; #include int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n,m; cin>>n>>m; vector u(m),v(m),w(m); for(int i = 0;i>u[i]>>v[i]>>w[i]; //u[i]--;v[i]--; } vector idx(m); for(int i = 0;i>t; vector q(t); for(int i = 0;i>q[i]; vector id(t); for(int i = 0;i ans(t,0); atcoder::dsu uf(n); int now = n; int ni = 0; for(int i = 0;i