Editorial for An Animal Contest 2 P2 - Koala Party
Submitting an official solution before solving the problem yourself is a bannable offence.
Given that each is unique, we realize that the answer is always , , or .
If , the answer is if the total number of cookies among all bowls is odd and if the total is even.
For all , the answer is if we can find three bowls , , and that form an arithmetic sequence, and otherwise.
We loop possible values of , , and , and check if the elements form an arithmetic sequence.
To optimize, we add all into a set and loop possible values of and , checking if is contained.