6. Cheburashka bought as many mirrors from Galina in the store as Gen bought from Shapoklyak. If Gen had bought from Galina, he would have 27 mirrors, and if Cheburashka had bought from Shapoklyak, he would have 3 mirrors. How many mirrors would Gen and Cheburashka buy together if Galina and Shapoklyak agreed and set the price of mirrors to the average of their current prices? (The average of two numbers is half of their sum, for example, for the numbers 22 and 28, the average is 25.)
Solution. Let Gena have $x$ times more money than Cheburashka. If we swap Gena's and Cheburashka's money, then with the second method of purchase, the number of mirrors should be equal. Therefore, $3 x=\frac{27}{x}$, from which $3 x^{2}=27$, and $x=3$. So, Gena initially had three times more money than Cheburashka, and the price at Shapoklyak is three times higher than at Galya. Thus, they had four times more money in total than Cheburashka, and the average price is twice as high as at Galya. Initially, Cheburashka could buy $3 \cdot 3=9$ mirrors, then together with Gena at the average price, they would buy $\frac{4 \cdot 9}{2}=18$ mirrors.