An integer N (1 ≤ N ≤ 3 × 10^5), representing some quantity or size.
A list of N non-negative integers, where each integer is between 0 and 1e9.
N-1 pairs of integers, each pair representing a connection between two entities, where each integer in the pair is between 1 and N.

### Example Input:

```
3
1 2 3
1 2
1 3
```

### Function Signature:
Write a function f(N, A, edges) that takes in the input.
def f(N: int, A: List[int], edges: List[Tuple[int, int]]):
    ''' 
    N: an integer 
    A: a list of integers
    edges: a list of tuples
    '''