Back to problems

Save the Universe

Algorithm · Rubrik · Hard

Rick and Morty have reached the 4th Dimension, where universes are linked together as a tree rooted at the prime universe. Every universe carries an evilness value. They want to use their splitting gun to divide the tree into vertical branches so that the sum of the evilness values across all branches is less than k. Unfortunately, the damaged gun can break a branch containing no more than m universes. Determine the smallest number of branches needed to split the tree and…

Checking your access…