The distance between the towns A and B is 1000 miles. There is 3000 apples in A, and the apples have to be delivered to B.

The available car can take 1000 apples at most. The car driver has developed an addiction to apples: when he has apples aboard he eats 1 apple with each mile made.

Figure out the strategy that yields the largest amount of apples to be delivered to B.

Generalize the strategy for an arbitrary amount of apples.

The available car can take 1000 apples at most. The car driver has developed an addiction to apples: when he has apples aboard he eats 1 apple with each mile made.

Figure out the strategy that yields the largest amount of apples to be delivered to B.

Generalize the strategy for an arbitrary amount of apples.