func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 405;   int n, kk;   vector<pair<int, int>> v[N][N], e[N];   int dp[N][N], sz[N], f[N];   void dfs1(int pos, int fa) {     sz[pos] = 1;     for (auto &i : e[pos])       if (i.first != fa) {         dfs1(i.first, pos);         sz[pos] += sz[i.first];         f[i.first] = i.second;       }   }   void dfs2(int pos, int fa) {     if (pos == 1)       dp[pos][sz[pos]] = 0;     else       dp[pos][sz[pos]] = 1;     dp[pos][0] = 0;     for (auto &i : e[pos]) {       if (i.first == fa) continue;       dfs2(i.first, pos);       for (int j = sz[pos] - 1; j > 0; --j) {         int tk = -1;         for (int k = 0; k <= sz[i.first] && k <= j; k++)           if (dp[pos][j] > dp[i.first][k] + dp[pos][j - k]) {             dp[pos][j] = dp[i.first][k] + dp[pos][j - k], tk = k;             v[pos][j] = v[pos][j - tk], v[pos][j].push_back({i.first, tk});           }         if (tk != -1)           v[pos][j] = v[pos][j - tk], v[pos][j].push_back({i.first, tk});       }     }   }   void print_ans(int pos, int cnt) {     if (sz[pos] == cnt) {       cout << f[pos] <<    ;       return;     }     for (auto &i : v[pos][cnt]) print_ans(i.first, i.second);   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> kk;     cin.tie(0);     for (int i = 1; i < n; i++) {       int t1, t2;       cin >> t1 >> t2;       e[t1].push_back({t2, i});       e[t2].push_back({t1, i});     }     memset(dp, 63, sizeof(dp));     dfs1(1, 0);     dfs2(1, 0);     int ans = dp[1][n - kk], pos = 1;     for (int i = 2; i <= n; i++)       if (sz[i] >= kk && ans > dp[i][sz[i] - kk] + 1)         ans = dp[i][sz[i] - kk] + 1, pos = i;     cout << ans << endl;     if (pos != 1) cout << f[pos] << endl;     print_ans(pos, sz[pos] - kk);     return 0;   }   