5. In Ali-Baba's cave, there is a lot of gold and diamonds. A full bag of gold weighs 200 kg, a full bag of diamonds 40 kg.

75 What is better?

Ali-Baba can carry 100 kg at a time. One kilogram of gold is worth 20 dinars, one kilogram of diamonds is worth 60 dinars. How much money can he get for the gold and diamonds he carries in one bag (in one trip)?
5. First, note that 5 kg of gold has the same volume as 1 kg of diamonds, but is more expensive. We will prove that: 1. Ali-Baba can get 3000 dinars for the treasures. Indeed, the bag can hold 40 kg of diamonds. If we replace 15 kg of diamonds with 75 kg of gold, the volume of the bag will remain the same, and its value will be 3000 dinars. 2. Now we will prove that 3000 dinars is the maximum amount that can be obtained for the treasures. If we remove some diamonds from the bag containing 25 kg of diamonds and 75 kg of gold, they can be replaced with the same amount of gold (to avoid exceeding the weight limit), which will reduce the total value, as diamonds are more expensive. If we remove some gold, the total value will also decrease, as the weight of the diamonds taken in place of it will be five times less (otherwise, there will be an excess in volume!). For example, if we take $5 x$ kg of gold and replace it with $x$ kg of diamonds, the value of the treasures will decrease by $40 x$ dinars. Answer: 3000 dinars.