Colorful Balls#3

Colorful Balls (Editorial)

Problem Author:

Oleksandr Tymkovich

Prepared by:

Oleksandr Tymkovich, Feysa Bohdan

Editorial by:

Oleksandr Tymkovich

In this problem, it is sufficient to consider all possible cases: which box will contain only blue balls, which will contain only yellow balls, and which will remain empty.

For example, if you want a box to contain only yellow balls, then you need to rearrange all the blue balls from it. If the task is to make the box empty, then you need to rearrange all the balls from it.