5332: Rebuild Tree

内存限制:512 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

Bob has a tree with n nodes, the set of the edges of this tree is T.
Let B denote the edge set of n-clique, formally B={(i,j)∣1≤i<j≤n}
Now give you an integer k, you need to find the number of pair (X,Y) satisfies the following conditions:
  1. X⊆T, Y⊆B.
  2. ∣X∣=n−1−k, ∣Y∣=k.
  3. X∪Y is an edge set of a tree with n nodes.
The answer may be very large, you only need to output the answer module 998244353.

输入

The first line has two integers n,k.
Then there are n−1 lines, each line has two integers u,v denote an edge (u,v) in T.
2≤n≤5×104
1≤k≤min(100,n−1)

输出

Output the answer.

样例输入 复制

5 1
1 2
2 3
2 4
1 5

样例输出 复制

提示

18