The first line contains the space separated values of and . The next lines contains space separated integers.
Answers
Answered by
0
Answer:
Input: The first line contains an integer N denoting the number of nodes in the tree. Next line contains N space separated integers where the ith integer denotes A[i]. Next N-1 lines consist of two space-separated integers u and v, denoting that there is an edge between node u to node v.
Similar questions