#P1619. I love tree
I love tree
题目描述
Given a tree with nodes and operations, there are two kinds of operations.
- : for a chain <,>,increase the value of to the x-th point on this chainfor example thechain from a to =(,,,,),after the operation,
- :asks the value of x-th node
输入格式
There is only one test case for this question. The first line contains one integer . The next line contains two integers ,,which means that there is an edge between and . The first line contains one integer . The i-th of the following lines is in one of the 2 formats:
- .
- .
输出格式
Each line output one integer represents the answer.
样例
3
1 2
2 3
5
1 1 2
2 1
1 2 1
2 2
2 3
1
5
0
提示
Add by FZSF.