#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x E[2020]; ll val[2020][2020]; ll mo=1000000007; int num[2020]; void dfs(int cur,int pre) { num[cur]=1; ll nn[2][2020]; int i,j,x; ZERO(nn); FOR(i,E[cur].size()) if(E[cur][i]==pre) break; if(i>N>>K; FOR(i,N-1) { cin>>x>>y; E[x].push_back(y); E[y].push_back(x); } dfs(0,-1); cout<