#include #include std::vector< std::pair > V[100010]; int check[100010]; void func(int k, int prev, int C) { check[k] = C; for(int i=0;i