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 <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=998244353;
int n, k;
vector<int> g[100010];
vector<ll> dp[2][100010];
bool used[100010];
void dfs(int x){
    used[x]=1;
    dp[0][x].resize(1);
    dp[1][x].resize(2);
    dp[0][x][0]=dp[1][x][1]=1;
    for(auto y:g[x]){
        if(used[y]) continue;
        dfs(y);
        vector<ll> v(2*k+1), w(2*k+1);
        for(int i=0; i<dp[0][x].size(); i++){
            for(int j=0; j<dp[0][y].size(); j++){
                (v[i+j]+=dp[0][x][i]*dp[0][y][j])%=MOD;
            }
            for(int j=1; j<dp[1][y].size(); j++){
                (v[i+j]+=dp[0][x][i]*dp[1][y][j])%=MOD;
            }
        }
        for(int i=1; i<dp[1][x].size(); i++){
            for(int j=0; j<dp[0][y].size(); j++){
                (w[i+j]+=dp[1][x][i]*dp[0][y][j])%=MOD;
            }
            for(int j=1; j<dp[1][y].size(); j++){
                (w[i+j]+=dp[1][x][i]*dp[1][y][j])%=MOD;
                (w[i+j-1]+=dp[1][x][i]*dp[1][y][j])%=MOD;
            }
        }
        while(v.size()>k+1 || v.back()==0) v.pop_back();
        while(w.size()>k+1 || w.back()==0) w.pop_back();
        dp[0][x]=v;
        dp[1][x]=w;
    }
}
int main()
{
    cin>>n>>k;
    for(int i=0; i<n-1; i++){
        int x, y; cin>>x>>y;
        x--; y--;
        g[x].push_back(y);
        g[y].push_back(x);
    }
    dfs(0);
    ll ans=dp[1][0][k];
    if(dp[0][0].size()>=k+1) (ans+=dp[0][0][k])%=MOD;
    cout<<ans<<endl;
    return 0;
}