Types: n: int, m: int, p: int, edges: List[Tuple[int, int, int]], c: List[int]
Ranges: 3 ≤ n ≤ 100, 0 < weight of the edge < 10000
Addtl Info: No parallel edges, no self-loops, input terminates with n = m = p = 0