Time limit: 2 seconds
Memory limit: 256 megabytes
----------
After her adventures in Vietnam, Sana is lost in the jungles of Vietnam, and her GPS is out of order.
The map of Vietnam is modeled as a weighted tree with $n$ vertices; every edge has a positive weight, and the distance between two vertices is the sum of the weights of the edges on the unique path between them. Sana knows that she is located at one of the vertices of this tree.
Using her knowledge of signals, she has built a device that can connect to the telecommunication towers at different vertices. Each time she receives a signal, based on the signal round-trip time, she concludes that the distance from the vertex she is currently at to a specified vertex is no more than a certain amount.
Now Sana wants to write a program to identify her location by analyzing this data.
You must process $q$ queries. In each query, either a new signal is received, or Sadra (Sana's impatient younger brother) asks her whether, given the information received so far, it is possible for her to be at vertex $v$.
We have two types of queries:
+ 1 v x :
From this moment onward, we know the distance to vertex $v$ is at most $x$.
+ 2 v :
You must answer the question of whether it is possible to be at vertex $v$ or not.
It is possible that none of the vertices satisfy the received information. Pay attention to the first example.
# Input
The first line of the input contains $T$, the number of test cases.
The first line of each test case contains the number $n$, the number of vertices in the tree.
In the next $n - 1$ lines, the edges of the tree are described. Each line contains three numbers $v_i, u_i, w_i$ in order, meaning there is an edge with weight $w_i$ between vertices $v_i$ and $u_i$.
The next line contains $q$, the number of queries.
In each of the next $q$ lines, a query of one of the two following formats appears:
+ 1 v x
+ 2 v
# Output
For every type 2 query, print `Yes` on a single line if it is possible for Sana to be at that vertex, and `No` if it is not possible.
# Constraints
$$ 1 \leq T \leq 10^5 $$$$ 1 \leq n \leq 2 \cdot 10^5 $$$$ 1 \leq w_i \leq 1000 $$
$$ 1 \leq q \leq 4 \cdot 10^5 $$$$ 1 \leq v \leq n $$$$ 1 \leq x \leq 10^9 $$
+ It is guaranteed that the input sequence describes a tree.
$$ \sum n \leq 2 \cdot 10^5 $$
$$ \sum q \leq 4 \cdot 10^5 $$
# Example
```
2
3
1 2 2
1 3 2
6
1 1 2
2 2
1 1 1
2 2
1 2 0
2 1
6
1 2 262
1 3 396
2 6 724
3 4 693
4 5 845
9
1 5 2501
2 6
2 5
1 3 1273
2 5
1 1 372
1 6 871
2 3
2 2
```
```
Yes
No
No
No
Yes
No
No
Yes
```
Post an answer to this question
You currently do not have access.