
There exists an undirected and initially unrooted tree with n nodes indexed from 0 to n - 1 . You are given the integer n and a 2D integer array edges of length n - 1 , where edges[i] = [a _i , b _i ] indicates that there is an edge between nodes a _i and b _i in the tree.
Each node has an associated price. You are given an integer array price , where price[i] is the price of the i ^th node.
The price sum of a given path is the sum of the prices of all nodes lying on that path.
The tree can be rooted at any node root of your choice. The incurred cost after choosing root is the difference between the maximum and minimum price sum amongst all paths starting at root .
Return the maximum possible cost amongst all possible root choices .
1 <= n <= 10 ^5edges.length == n - 10 <= a _i , b _i <= n - 1edges represents a valid tree.price.length == n1 <= price[i] <= 10 ^5