Behruzbek received a tree$$$^{\text{∗}}$$$ with $$$n$$$ nodes. For a chosen root$$$^{\text{†}}$$$ $$$r$$$, Behruzbek wants to find cuteness of the tree.
Consider every set of $$$k$$$ distinct nodes of the tree. For each such set, compute its lowest common ancestor (LCA) in the tree when it is rooted at $$$r$$$. Let $$$S_r$$$ be the set of all distinct nodes obtained this way; then cuteness of the tree is $$$|S_r|$$$, where $$$|S|$$$ means the number of distinct elements.
After discovering the cuteness of trees, Behruzbek became interested in finding the kawaiiness of the tree! Kawaiiness is defined as:
$$$$$$ \sum_{r = 1}^{n} |S_r| = |S_1| + |S_2| + \dots + |S_n| $$$$$$
Unfortunately, Behruzbek is feeling sleepy now. Please help Behruzbek by finding the kawaiiness of the tree!
$$$^{\text{∗}}$$$A tree is a connected graph without cycles.
$$$^{\text{†}}$$$A rooted tree is a tree where one vertex is special and called the root.
The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^{4}$$$).
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$2 \leq k \leq n \leq 2\cdot 10^{5}$$$) — the number of vertices in the tree and the number of distinct integers to be chosen.
The following $$$n-1$$$ lines of each test case describe the tree. Each of the lines contains two integers $$$u$$$ and $$$v$$$ ($$$1 \leq u,v \leq n$$$, $$$u \ne v$$$) that indicate an edge between vertex $$$u$$$ and $$$v$$$. It is guaranteed that these edges form a tree.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^{5}$$$.
For each test case, output one integer — the value of $$$\sum\limits_{r=1}^n |S_r|$$$.
42 21 25 31 21 31 41 56 31 21 32 42 53 610 55 64 93 92 62 88 96 101 64 7
291735
Let $$$f(i) = |S_i|$$$
For the third example:
Overall, $$$2 + 2 + 3 + 3 + 3 + 4 = 17$$$.