Pretty Painting (prettypainting)

21 teams scored 1610 points on this task, for a maximum score of 100, an average score of 76.7 and a median score of 100.

Highlights

  1. Banfi, Vimercate is the institute with the most points (200).
  2. Lombardia is the region with the most points (512).

Statement

Valerio is drawing his (rooted) Christmas tree to celebrate his favorite holiday. Being a computer scientist, his tree has N nodes, numbered from 0 to N-1, with node 0 being the root. Each other node is connected to its parent P_i by an edge of length W_i. Valerio now wants to color some of the edges to make his drawing look more similar to the original subject. He also wants to avoid making the drawing too chaotic, therefore each node i can have at most K_i incident colored edges. What is the maximum total length of colored edges he can achieve?