You have been given the task of transporting 3,000 apples 1,000 miles from Appleland to Bananaville.
Your truck can carry 1,000 apples at a time.
Every time you travel a mile towards Bananaville you must pay a tax of 1 apple
but you pay nothing when going in the other direction (towards Appleland).

It should be 833 apples left with him.
First he'll travel 333 miles 3 times(1000 apples on each turn). He is left with 2001(3000-999).
He'll eat 1 Apple. Now 2000 apples he can transport in 2 trips. He'll travel 500 miles 2 times. 1000 apples will go for tax. Rest 1000 apples he'll transport in 1 turn for the rest 167 miles. On his way he'll pay 167 apples as tax.
Finally he'll left out with 833 apples !!