There are multiple test cases. The first line of input contains an integer $T$, indicating the number of test cases. For each test case:
The first line contains two integers $n$ and $m$ $(1 \le n \le 2000, 1 \le m \le 10^9)$, the number of vertices and the number of operations.
The following $n-1$ lines describe the edges. The $i$-th line contains three integer $u_i$, $v_i$ and $c_i$ $(1 \le u_i, v_i \le n, 1 \le c_i \le 10^4)$ indicating that there is edge between vertex $u_i$ and vertex $v_i$ and the length is $c_i$.
The next line contains $n$ integers $w_1, w_2, \dots, w_n$ $(1 \le w_i \le 10^4)$, where $i$-th integer denotes the vitalness of $i$-th color.