func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 110;   const int MOD = 1e9 + 7;   long long n, k, dp[MAXN][MAXN][MAXN], local[MAXN][MAXN];   vector<int> adj[MAXN];   void add(long long& v, long long u) { v = (v + u) % MOD; }   void dfs(int v, int par = -1) {     dp[v][1][0] = dp[v][0][1] = 1;     for (auto i : adj[v]) {       if (i == par) continue;       dfs(i, v);       for (int w = 0; w < 23; w++)         for (int j = 0; j < 50; j++) {           local[w][j] = dp[v][w][j];           dp[v][w][j] = 0;         }       for (int a = 0; a <= (k + 1); a++)         for (int b = 0; b <= (2 * k + 1); b++)           for (int c = 0; c <= (k + 1); c++)             for (int d = 0; d <= (2 * k + 1); d++) {               int locala = 0;               if (!d) locala = b;               if (!b && d) locala = d + 1;               if (b && d) locala = min(b, d + 1);               int localb = a;               if (localb && locala) {                 if ((localb - 1 + locala - 1) <= k) localb = 0;               }               int localc = c;               if (localc) localc++;               if (localc && locala) {                 if ((locala - 1 + localc - 1) <= k) localc = 0;               }               int locald = 0;               if (!localc) locald = localb;               if (!localb && localc) locald = localc;               if (localb && localc) locald = max(localc, localb);               if (locald <= (k + 1) && locala <= (2 * k + 3))                 add(dp[v][locald][locala], local[a][b] * dp[i][c][d] % MOD);             }     }   }   int main() {     ios::sync_with_stdio(0);     cin >> n >> k;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dfs(1);     long long answer = 0;     for (int i = 0; i <= (2 * k + 3); i++) answer = (answer + dp[1][0][i]) % MOD;     cout << answer << endl;     return 0;   }   