You are given an undirected tree with N nodes. Every node is initially assigned a value equal to 0.
Perform Q queries that are given on the tree as follows:
Task
Find the sum of values assigned to all the nodes after performing Q queries.
Input
Output
For each test case in a new line, print the sum of values assigned to each node after performing Q queries.
Constraints
1≤T≤51≤N,Q≤1050≤w≤109
Initial values of the nodes in the tree is [0,0,0].
For 1st Query:
For 2nd Query:
Sum of all the nodes in the tree is 5+5=10