#include #include int x[400010]; std::vector V[400010]; int check[400010]; int func(int k) { if(check[k]) return 0; check[k] = 1; int ans = x[k]; for(int i=0;i