A truck driver has been tasked with transporting apples between towns and , which are miles apart. However, if the truck driver is driving while there are apples in his truck, he will eat them at a rate of apple per mile. The truck has a maximum capacity of apples at any one time. The driver may deposit apples at any point between and .
How can he get the maximum possible number of apples from town to town ?