The first line of the input contains an integer $T(1\leq T\leq 10000)$, denoting the number of test cases.
In each test case, there are two integers $n,m(1\leq n,m\leq 300000)$ in the first line, denoting the number of nodes and cameras.
In the second line, there are $n-1$ integers $f_2,f_3,...,f_n(1\leq f_i<i)$, denoting the father of each node.
In the third line, there are $n$ integers $a_1,a_2,...,a_n(1\leq a_i\leq 10^9)$, denoting the number of apples on each node.
For the next $m$ lines, each line contains three integers $x_i,k_i,c_i(1\leq x_i\leq n,0\leq k_i\leq n,1\leq c_i\leq 10^9)$, denoting each camera.
It is guaranteed that $\sum n\leq 10^6$ and $\sum m\leq 10^6$.