Problem

Source: All-Russian 2022 9.4

Tags: combinatorics, algebra



There are $18$ children in the class. Parents decided to give children from this class a cake. To do this, they first learned from each child the area of the piece he wants to get. After that, they showed a square-shaped cake, the area of which is exactly equal to the sum of $18$ named numbers. However, when they saw the cake, the children wanted their pieces to be squares too. The parents cut the cake with lines parallel to the sides of the cake (cuts do not have to start or end on the side of the cake). For what maximum k the parents are guaranteed to cut out $k$ square pieces from the cake, which you can give to $k$ children so that each of them gets what they want?