#include <bits/stdc++.h> #define ios ios::sync_with_stdio;cin.tie(0);cout.tie(0) using namespace std; const int N = 1e6+100; struct node { int u, v; }; int n, p; int dfn[N], cnt[N]; vector<node> lst; void dfs(int pos) { if(p > n) return ; int id = dfn[pos]; for(int i = 0; i < c...