The input contains several test cases, and the first line contains a single
integer
T , the number of test cases.
For each test case:
The first line
contains three integers
n,m,rt .
For the following
n−1 lines, each line contains three integers
u,v,d , which means that there is an edge between
u,v , the weight of which is
d .
The next line contains
n integers, the ith integer is
ai .
For the following
m lines, each line contains three integers
opt,l,r , which means that there is a operation of type
opt for
l,r .
1≤T≤4 ,
1≤n,m≤2⋅105 , the weight of edge is an integer in range
[0,109] .