#include #define int long long #define all(v)v.begin(),v.end() #define rall(v)v.rbegin(),v.rend() using namespace std; templateistream&operator>>(istream&I,vector&v){for(auto&i:v)I>>i;return I;} templateostream&operator<<(ostream&O,vector&v){for(auto&i:v)O<>gx>>gy>>k; for(int i=0;i>x[i]>>y[i]>>c[i]; } dfs(0,k); cout<>t; while(t--)AC::solve(); }