Dividing into Groups
Chef has $N$ boxes, numbered from $1$ to $N$. The $i^{th}$ box contains $A_i$ candies, which are all of the same color. Also, candies from two different boxes never have the same color. Your goal is to create as many $\text{Groups}$ as possible, where - A $\text{Group}$ is a collection of exactly $K$ candies. - No two candies in the same $\text{Group}$ can have the same color. - A particular can
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start