Ali-Baba came to a cave where there is gold, diamonds, and a chest in which he can carry them away. A full chest of gold weighs 200 kg, a full chest of diamonds - 40 kg, an empty chest weighs nothing. A kilogram of gold is worth 20 dinars on the market, a kilogram of diamonds - 60 dinars. Ali-Baba can lift and carry no more than 100 kg. What is the maximum amount of money he can get for the treasures he brings out of the cave in one go?
Suppose Ali-Baba can carry $x$ kg of gold and $y$ kg of diamonds out of the cave. In this case, he can obtain $20x + 60y$ dinars. Since Ali-Baba can carry no more than 100 kg, we have $x + y \leq 100$ (*). 1 kg of gold occupies $1/200$ of a chest, and 1 kg of diamonds occupies $1/40$ of a chest. Therefore, $x/200 + y/40$ or $x + 5y \leq 200$ (**).

Adding inequalities (*) and (**) and multiplying by 10, we get: $20x + 60y \leq 3000$. Therefore, Ali-Baba can obtain no more than 3000 dinars for the treasures.

It remains to show that Ali-Baba can carry treasures worth this amount. For this, it is necessary and sufficient that the equalities are satisfied in inequalities (*) and (**). Solving the corresponding system of equations, we find $x = 75, y = 25$. This means that Ali-Baba can obtain 3000 dinars by taking 75 kg of gold and 25 kg of diamonds from the cave.

## Answer

3000 dinars.