Problem 2305 · Medium

Fair Distribution of Cookies

Backtrack over which child receives each cookie, pruning any branch that cannot beat the best unfairness found so far.

Open the interactive visualisation