#include using namespace std; #define LL long long #define LD long double int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } const LL INF=1e18; const LD eps=1e-18; const int N=5e5+10; const LL P=998244353; const LD PI=acos(-1.0); LL qpow(LL x,LL y){ LL re=1; while(y){ if(y&1) re=re*x%P; x=x*x%P;y>>=1; } return re; } int n,K,ans; vector V[100005]; int vis[100005],dep[100005],f[100005]; void dfs(int x,int fa){ dep[x]=dep[fa]+1; if(vis[x]) f[x]=dep[x]; else f[x]=0; for(int i=0;i