An integer N (2 ≤ N ≤ 10^5), representing some quantity or size.
A list of integers A of size N, where each integer is between 0 and 1e9.
A list of N-1 tuples, each containing two integers a_i and b_i (1 ≤ a_i, b_i ≤ N).

### Example Input:

```
5
1 2 1 1 2
2 4
5 2
3 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 of two integers
    '''