There are multiple test cases. The first line of input contains an integer $T$ $(1 \le T \le 500)$, indicating the number of test cases. For each test case:
The first line contains two integers $n$ and $D$ $(1 \le n \le 100000, 1 \le D \le 10^9)$.
The second line contains $n$ integers $p_1, p_2, \dots, p_n$ $(0 \le p_i \le 10^9)$.
Each of the following $n - 1$ lines describing roads contains two integers $u, v$ $(1 \le u, v \le n, u \ne v)$ meaning that there is a road connecting city $u$ and city $v$.
It is guaranteed that the total number of vertices in the input doesn't exceed $5 \times 10^5$.