5. Malvina and Buratino play according to the following rules: Malvina writes six different numbers in a row on the board, and Buratino comes up with his own four numbers $x_{1}, x_{2}, x_{3}, x_{4}$ and writes under each of Malvina's numbers one of the sums $x_{1}+x_{2}, x_{1}+x_{3}, x_{1}+x_{4}$, $x_{2}+x_{3}, x_{2}+x_{4}, x_{3}+x_{4}$ (each one exactly once). For each sum that equals the number above it, Buratino gets 3 apples, and for each sum that is greater, he gets 1 apple. What is the maximum number of apples that Buratino can guarantee to get?
# Answer: 14.

## Solution.

Solution. Let Malvina write the numbers $a_{1}>a_{2}>a_{3}>a_{4}>a_{5}>a_{6}$. If Buratino comes up with the numbers $x_{1}=\left(a_{1}+a_{2}-a_{3}\right) / 2, x_{2}=\left(a_{1}+a_{3}-a_{2}\right) / 2, x_{3}=\left(a_{2}+a_{3}-a_{1}\right) / 2, x_{4}=a_{4}-x_{3}$, then by writing $x_{1}+x_{2}=a_{1}$ under $a_{1}, x_{1}+x_{3}=a_{2}$ under $a_{2}, x_{2}+x_{3}=a_{3}$ under $a_{1}, x_{3}+x_{4}=a_{4}$ under $a_{4}$, $x_{1}+x_{4} \geqslant a_{4} \geqslant a_{5}$ under $a_{5}$ and $x_{2}+x_{4} \geqslant a_{4} \geqslant a_{6}$ under $a_{6}$, he will get 14 apples.

To get more than 14 apples, Buratino must ensure at least 5 equalities, which is not always possible: among any 5 sums composed by Buratino, there are such 4 that the sum of two of them equals the sum of the other two. Therefore, if Malvina writes such 6 numbers that the sum of no two of them equals the sum of any other two (for example, $1,10,100,1000,10000,100000$), then Buratino will not be able to get 15 or more apples.