You have been given the task of transporting 3,000 apples for 1000 miles from City A to City B. Your truck can carry 1000 apples at a time. Every time you travel a mile towards City B you must pay a tax of 1 apple but you pay nothing when going towards City A. What is highest number of apples you can get to City B?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
In order to get maximum number apples when arriving at City B , the truck must load maximum number of apples towards to City B . In this case, the truck must load 1 0 0 0 apples. Due to tax, the truck driver should be clever so the steps he should do are:
The number of apples that is left at point P should be minimum. We set 1 0 0 0 − 3 x = 0 . Therefore x = ⌊ 3 1 0 0 0 ⌋ = 3 3 3 . The number of apples that is carried by the truck at point Q should be maximum. We set 2 0 0 0 − 2 y = 1 0 0 0 . Therefore y = ⌊ 2 2 0 0 − 1 0 0 0 ⌋ = 5 0 0 . Thus, the maximum number of apples that is left when arriving at B is 2 0 0 0 − 2 y − ( 1 0 0 0 − y − x ) = 1 0 0 0 − y + x = 1 0 0 0 − 5 0 0 + 3 3 3 = 8 3 3 Anyway, during the process, the truck driver will leave an apple at point P . If I were the truck driver, I would eat that apple instead of leaving it offhand. LOL. # Q . E . D . #
Problem Loading...
Note Loading...
Set Loading...
Step one: First you want to make 3 trips of 1,000 apples 333 miles. You will be left with 2,001 apples and 667 miles to go.
Step two: Next you want to take 2 trips of 1,000 apples 500 miles. You will be left with 1,000 apples and 167 miles to go (you have to leave an apple behind).
Step three: Finally, you travel the last 167 miles with one load of 1,000 apples and are left with 833 apples in CITY B.