Types: N: int, P: List[int], X: List[int]

Ranges: 1 ≤ N ≤ 1,000, 1 ≤ P[i] ≤ i - 1, 0 ≤ X[i] ≤ 5,000

Addtl Info: Vertex 1 is the root of the tree.