Problem 2920 · Hard

Maximum Points After Collecting Coins From All Nodes

Each node either takes its coins minus k or halves them, and a halving at an ancestor halves every coin count below it, so a tree DP over the number of halvings works.

Open the interactive visualisation