The first line contains an positive integer $T$, represents there are $T$ test cases.
For each test case:
The first line contains two positive integers $n$ and $k$.
The second line contains $(n-1)$ positive integers, represent $d_1,d_2,\cdots,d_{n-1}$.
The next $n$ lines, the $i$-th line contains three positive integers $a_i,r_i$ and $b_i$.
There is a blank between each integer with no other extra space in one line.
$1\leq T\leq 100,2\leq n\leq 2\cdot10^4,1\leq k\leq\min(n, 100),1\leq a_i,b_i,d_i,r_i\leq 10^5,1\leq\sum{n}\leq10^5$