func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 1e2 + 10;   const int maxm = 22;   const int mod = 1e9 + 7;   vector<int> G[maxn];   int dp[maxn][maxn][maxm];   int sum[maxn][maxn][maxm];   int n, k;   void init() {     for (int i = 0; i <= n; ++i) G[i].clear();   }   void addEdge(int a, int b) {     G[a].push_back(b);     G[b].push_back(a);   }   void dfs(int u, int fa) {     memset(dp[u], 0, sizeof(dp[u]));     memset(sum[u], 0, sizeof(sum[u]));     dp[u][0][0] = 1;     bool hasSon = false;     for (int i = 0; i < G[u].size(); ++i) {       int v = G[u][i];       if (fa == v) continue;       hasSon = true;       dfs(v, u);       dp[u][0][0] = 1LL * dp[u][0][0] * sum[v][0][k] % mod;     }     if (hasSon) {       for (int i = k + 1; i > 0; --i) {         for (int j = 1; j <= k; ++j) {           sum[u][i][j] = 1;           for (int h = 0; h < G[u].size(); ++h) {             int v = G[u][h];             if (v == fa) continue;             sum[u][i][j] = 1LL * sum[u][i][j] * sum[v][i - 1][j - 1] % mod;           }           dp[u][i][j] = (sum[u][i][j] - sum[u][i + 1][j] - sum[u][i][j - 1] +                          sum[u][i + 1][j - 1]) %                         mod;           if (dp[u][i][j] < 0) dp[u][i][j] += mod;           if (i + j - 1 <= k) {             dp[u][i][0] = (dp[u][i][0] + dp[u][i][j]) % mod;             dp[u][i][j] = 0;           }         }       }     } else {       dp[u][k][1] = 1;     }     for (int i = k + 1; i >= 0; --i) {       for (int j = 0; j <= k; ++j) {         sum[u][i][j] = dp[u][i][j];         if (i + 1 <= k + 1) (sum[u][i][j] += sum[u][i + 1][j]) %= mod;         if (j) (sum[u][i][j] += sum[u][i][j - 1]) %= mod;         if (i + 1 <= k + 1 && j)           (sum[u][i][j] -= sum[u][i + 1][j - 1] - mod) %= mod;       }     }   }   void debug() {     for (int i = 1; i <= n; ++i) {       for (int j = 0; j <= k; ++j) {         for (int h = 0; h <= k; ++h) {           printf( p[%d][%d][%d] = %d  , i, j, h, sum[i][j][h]);         }         puts(  );       }       puts(  );     }   }   int main() {     while (~scanf( %d%d , &n, &k)) {       init();       for (int i = 0; i < n - 1; ++i) {         int a, b;         scanf( %d%d , &a, &b);         addEdge(a, b);       }       dfs(1, 0);       printf( %d n , sum[1][0][0]);     }     return 0;   }   