# Question :

A person has 3000 bananas and a camel. The person wants to transport the maximum number of bananas to a destination which is 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to the destination using only camel (no other mode of transportation is allowed).

# Solution :

If the camel doesn’t eat a banana while returning, which means when it doesn’t have a banana, then the maximum number of bananas that can be transferred will be 833.

Let us divide the journey into 3 parts. First, the camel takes 1000 bananas and travels 333 KMs and puts the remaining bananas (1000–333 = 667) at first intermediate place and returns back to the source. Similarly, two more times, the camel takes 1000 bananas and travel for 333 KMs and put there remaining. Now, the total numbers of bananas are 2001 at the first intermediate place.

Again, the camel takes 1000 bananas and travels 500 KMs and puts the remaining bananas(1000–500=500) at second intermediate place and returns back to first intermediate place. Similarly one more times, the camel takes 1000 bananas and travels for 500 KMs and put there remaining bananas. Now, the total number of bananas is 1000 at the second intermediate place.

At last, the camel takes 1000 bananas and travels the remaining journey to 167 KMs. Thus, the total number of bananas is 833 at the final destination.

So, the maximum number of bananas can be transferred is 833, if the camel doesn’t eat a banana while returning.

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

--

--

--

## More from Placewit

Upskilling students for tech placements!

Love podcasts or audiobooks? Learn on the go with our new app.

## Placewit

Upskilling students for tech placements!