Problem 1815 · Hard

Maximum Number of Groups Getting Fresh Donuts

Only the remainder of each group size matters, so a memoized search over remainder counts decides which groups start fresh batches.

Open the interactive visualisation