Problem 2558 · Easy

Take Gifts From the Richest Pile

Each second take the richest pile down to its square root, found with a max heap, then sum what is left.

Open the interactive visualisation