5. The sides of 100 identical equilateral triangles are painted in 150 colors such that exactly two sides are painted in each color. If two triangles are placed with their same-colored sides together, the resulting rhombus will be called good. Petya wants to form as many good rhombi as possible from these triangles, with each triangle being used in no more than one rhombus. What is the maximum number of good rhombi that Petya can guarantee himself, regardless of the coloring method? (S. Berlov, I. Rubanov)
Answer: 25. Solution: Why is it always possible to get 25 good rhombuses? Let's construct the maximum possible number of good rhombuses. Suppose there are fewer than 25. Then there are at least 52 triangles that have not entered any good rhombus. Let's call such triangles single. For each triangle, choose a color, exactly one side of which belongs to the given triangle. We will call such colors highlighted. Thus, we have at least 52 highlighted colors. Note that for each highlighted color, one of the sides of this color does not belong to a single triangle (otherwise, we could glue two single triangles along the sides of the given color and increase the number of good rhombuses). Then one of the sides of each highlighted color is a side of a good rhombus. Since there are at least 52 highlighted colors, and no more than 24 good rhombuses, there will be a good rhombus with at least 3 sides having highlighted colors. Then two of these sides are in different triangles. Consequently, we can split this rhombus into two triangles and each of them can be glued to a single triangle along the side of the highlighted color. The number of good rhombuses has increased again. Contradiction. Why can't we get more than 25 good rhombuses? Let's divide our triangles into 25 quartets, and colors into 25 sextets, and match each quartet of triangles with a sextet of colors so that all sextets are used. We will color the sides of the quartet of triangles, which are matched with colors 1,2,3,4,5,6, as follows: 123,144,255,366. Since any good rhombus from these triangles includes the triangle 123, we cannot form two good rhombuses from them. By doing this with each quartet, we get a coloring that does not allow forming more than 25 good rhombuses.