The first line contains an integer $q$, which represents the number of test cases.
For each test case, the first line contains two integer $n$ and $k$ $(1\leq n\leq 2 \times 10^{5},0\leq k<n)$.
For next $n-1$ lines , each line contains $3$ numbers $u,v,d$, which means that there is an edge between $u$ and $v$ weighted $d$ $(1\leq u,v\leq n,0\leq d \leq 10^{9})$.
You may assume that $\sum n \leq 10^{6}$.