Problem: G: Tree

problem

Given a tree consisting of N vertices. Each vertex of the tree is numbered from 1 to N. Of the N-1 edges, the i \ (= 1, 2, ..., N-1) edge connects the vertex u_i and the vertex v_i.

Write a program to find the number of K non-empty subgraph sets of this tree, each of which is concatenated and no two different subgraphs share vertices. However, the answer can be very large, so answer the remainder divided by 998244353.

Note that if the set of K subgraphs is the same, the ones with different order of K subgraphs are also equated.

Input format


N K
u_1 v_1
::
u_ {N-1} v_ {N-1}


Constraint

* 2 \ leq N \ leq 10 ^ {5}
* 1 \ leq K \ leq min (N, 300)
* 1 \ leq u_i, v_i \ leq N
* u_i \ neq v_i
* For i \ neq j (u_i, v_i) \ neq (u_j, v_j)
* All inputs are given as integers.
* The graph given is guaranteed to be a tree.



Output format

Print the integer that represents the answer on one line. Note that it prints too much divided by 998244353.

Input example 1


3 2
1 2
13


Output example 1


Five

There are five ways:

* \\ {1 \\} and \\ {2 \\}
* \\ {1 \\} and \\ {3 \\}
* \\ {2 \\} and \\ {3 \\}
* \\ {1, 2 \\} and \\ {3 \\}
* \\ {1, 3 \\} and \\ {2 \\}



Input example 2


4 4
1 2
13
14


Output example 2


1

There is only one way (\\ {1 \\}, \\ {2 \\}, \\ {3 \\}, \\ {4 \\}).

Input example 3


7 4
1 7
twenty one
7 4
3 4
5 7
6 3


Output example 3


166





Example

Input

3 2
1 2
1 3


Output

5

Solution (in CPP):

Solution:
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
constexpr ll MOD = 998244353;

int n, k;
ll dp[100010][310][2];
vector<int> sub(100010, 1);
vector<vector<int>> g(100010);

void rec(int cur, int pre)
{
    dp[cur][0][0] = dp[cur][1][1] = 1;
    int ma = min(k, 1);
    for (auto v : g[cur])
    {
        if (v == pre)
            continue;
        rec(v, cur);
        sub[cur] += sub[v];
        int s = min(k, sub[v]);
        vector<ll> nxt0(min(k, ma + sub[v]) + 1, 0), nxt1(min(k, ma + sub[v]) + 1, 0);
        for (int i = 0; i <= ma; i++)
        {
            for (int j = 0; j <= s; j++)
            {
                if (i + j > k)
                    break;
                ll sum = (dp[v][j][0] + dp[v][j][1]) * dp[cur][i][0] % MOD;
                nxt0[i + j] = (nxt0[i + j] + sum);
                if (nxt0[i + j] >= MOD)
                    nxt0[i + j] -= MOD;
            }
            for (int j = 0; j <= s; j++)
            {
                if (i + j > k)
                    break;
                ll sum = (dp[v][j][0] + dp[v][j][1]) * dp[cur][i][1] % MOD;
                nxt1[i + j] = (nxt1[i + j] + sum);
                if (nxt1[i + j] >= MOD)
                    nxt1[i + j] -= MOD;
            }
            for (int j = 1; j <= s; j++)
            {
                if (i + j - 1 > k)
                    break;
                ll sum = dp[v][j][1] * dp[cur][i][1] % MOD;
                nxt1[i + j - 1] = (nxt1[i + j - 1] + sum);
                if (nxt1[i + j - 1] >= MOD)
                    nxt1[i + j - 1] -= MOD;
            }
        }
        ma = min(k, ma + sub[v]);
        for (int i = 0; i <= ma; i++)
        {
            dp[cur][i][0] = nxt0[i];
            dp[cur][i][1] = nxt1[i];
        }
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n >> k;
    for (int i = 0; i < n - 1; i++)
    {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    rec(0, -1);
    cout << (dp[0][k][0] + dp[0][k][1]) % MOD << endl;
}