# The camel and the bananas

A Tuareg has 3,000 bananas in its plantation that must lead to a market that is 1000 kilometers away. To do the job, he only has a camel that can carry a maximum of 1000 bananas at a time but to feed himself he eats a banana for every kilometer he travels.

What is the largest amount of bananas you can transport to the oasis?

#### Solution

It is clear that if 1000 bananas are loaded on the camel, when arriving at the destination there will be none left and you will not have food to return to the starting point, so it is necessary to divide the route into several sections that allow you to deposit part of the load to continue transport on another trip without consuming all the bananas on the move.

The intermediate point must be less than 500km from the starting point because if you would not spend the 1000 bananas on the round trip and you could not leave any at the intermediate point. This forces that there are two intermediate points in the route.

Until you reach the first intermediate point, you must make 5 trips, three outbound and two back until you move the total of 3000 bananas so you will consume 5 bananas per each kilometer advanced. We are interested that at the end of this section we have 2000 bananas left because with only three trips (two outbound and one back) you can reach the second intermediate point. It is possible to arrive with 2000 bananas to a point located 200km from the origin so that it will load 1000 bananas on the first trip, leave 600 (since it must take 200 bananas for the return trip), repeat the trip with the same quantities and make one last one-way trip in which he will transport 800 bananas and consume 200 on the road. At this time the total number of bananas transported is 600 + 600 + 800 = 2000, the rest has eaten them.

At this point, we are interested in finding the next intermediate point that you should reach with 1000 bananas to from there make a single trip to the market. Since we have 2000 bananas, we will have to make two round trips and one return, so the effective consumption will be three bananas for each kilometer advanced. This means that it will consume 1000 bananas at the rate of 3 bananas per kilometer, which gives us a distance of 333.33 km. Thus the camel will load 1000 bananas, leaving 333.33 (since it must take 333.33 for the way back), will load the other 1000 of which 1000 - 333.33 = 666.66 will arrive. At this point, the camel has transported 1000 bananas up to a distance of 200 + 333.33 = 533.33Km.

Now you only have to make a trip of 1000 - 533.33 = 466.66Km with the 1000 bananas from which you will consume 466.66 and arrive with 1000 - 466.66 = 533.33 bananas.