The first line contains an integerindicating the number of nodes in the tree.
The second line containsintegers, and the
-th integer
indicates the original value of the
-th node.
Each of the nextlines contains two integers
and
, indicating an edge between
and
.
Output a real number indicating the minimum value of. Your answer will be considered correct if and only if the absolute or relative error of your answer to the correct answer is less than or equal to
.