Types: N: int, A: List[int], U: List[int], V: List[int]
Ranges: 1 ≤ N ≤ 5000, 1 ≤ |A[i]| ≤ 10^9, 1 ≤ U[i], V[i] ≤ N
Addtl Info: U[i] ≠ V[i], any two different devices are connected through some number of cables.