Problem 3772 · Hard
Root the tree at each node and add a child subtree only when its best connected score is positive.
Open the interactive visualisation