Problem

Source: Turkey Junior Math Olympiad 2019 #4

Tags: combinatorics, combinatorics proposed



There are $27$ cardboard and $27$ plastic boxes. There are balls of certain colors inside the boxes. It is known that any two boxes of the same kind do not have a ball with the same color. Boxes of different kind have at least one ball of the same color. At each step we select two boxes that have a ball of same color and switch this common color into any other color we wish. Find the smallest number $n$ of moves required.