The camel and the bananas
Asked at Optiver, SIG
You own 3000 bananas and a camel. The market is 1000 miles away across a desert. The camel can carry at most 1000 bananas at a time, and it eats 1 banana per mile walked (in either direction, it eats to move). You may drop bananas at intermediate points and pick them up later.
What is the maximum number of bananas you can get to the market?
Show a hint
While you have more than 1000 bananas, you need multiple trips over each mile, so the "eating cost per mile" is high. The cost per mile drops as your pile shrinks below each 1000-banana threshold.