func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 123457;   int n, m, S, A, D, R, h[N];   vector<int> adj[N];   bool is[N];   bool dfs(int v, int par = 0) {     h[v] = h[par] + 1;     bool c = is[v];     if (c && h[v] >= D) D = h[v], R = v;     if (c && h[v] == D && v < S) S = v;     for (int i = 0; i < adj[v].size(); ++i)       if (adj[v][i] != par) c |= dfs(adj[v][i], v);     if (c) ++A;     return c;   }   int main() {     cin >> n >> m;     int a, b;     for (int i = 0; i < n - 1; ++i) {       cin >> a >> b;       adj[a].push_back(b), adj[b].push_back(a);     }     h[0] = -1;     memset(is, false, sizeof(is));     S = 0, A = 0, D = 0;     for (int i = 0; i < m; ++i) {       cin >> R;       is[R] = true;     }     dfs(R);     dfs(R);     S = N;     dfs(R), dfs(R);     cout << S << endl << (A - 4) / 2 - D << endl;   }   