func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 100005;   int dp[maxn], ans;   const int inf = 1e9;   int a1, a2, adfds, fd;   vector<int> edge[maxn];   int n, m, d, num[maxn], fuck;   void dfs1(int u, int fa) {     int i;     for (i = 0; i < (int)edge[u].size(); i++) {       int v = edge[u][i];       if (v == fa) continue;       dfs1(v, u);       dp[u] = max(dp[u], dp[v] + 1);     }     if (num[u]) dp[u] = max(dp[u], 0);   }   void dfs2(int u, int fa, int fv) {     int flag = 0, i, j, k;     if (fv + 1 > d) flag = 1;     int l1 = -inf, id1 = 0, l2 = -inf, id2 = 0;     for (i = 0; i < (int)edge[u].size(); i++) {       int v = edge[u][i];       if (v == fa) continue;       if (dp[v] + 1 > d) flag = 1;       if (dp[v] >= l1) {         l2 = l1, id2 = id1;         l1 = dp[v], id1 = v;       } else if (dp[v] > l2) {         l2 = dp[v], id2 = v;       }     }     if (!flag) ans++;     for (i = 0; i < (int)edge[u].size(); i++) {       int v = edge[u][i];       if (v == fa) continue;       int fvv = fv;       if (v == id1)         fvv = max(fvv, l2);       else         fvv = max(fvv, l1);       if (num[u]) fvv = max(fvv, -1);       dfs2(v, u, fvv + 1);     }   }   int main() {     int i, j, k, a, b, c;     ans = 0;     scanf( %d%d%d , &n, &m, &d);     for (i = 0; i <= n; i++) {       dp[i] = -inf;       edge[i].clear();     }     for (i = 1; i <= m; i++) {       scanf( %d , &a);       num[a] = 1;     }     for (i = 1; i < n; i++) {       scanf( %d%d , &a, &b);       edge[a].push_back(b);       edge[b].push_back(a);     }     dfs1(1, 0);     dfs2(1, 0, -inf);     printf( %d n , ans);   }   