Types: N: int, A: List[int], edges: List[Tuple[int, int]]
Ranges: 1 ≤ N ≤ 3 × 10^5, 0 ≤ A_i ≤ 10^9, 1 ≤ u_i < v_i ≤ N
Addtl Info: The graph is guaranteed to be a tree. All input is given as integers.