You have an electric car that you want to use to transport some batteries 1,000 miles. You have 3,000 batteries, but your car can only carry 1,000 of them at once. In addition, for each mile that it travels, the car will need to use up one battery in order to power itself.
How many unspent batteries will you be able to transfer to your destination?
1000 unspent batteries can be moved to the destination.
Note that the posted solution already allows for partial use of a battery. Also note the question "How many unspent batteries will you be able to transfer to your destination?" allows for the 1/3 battery to be counted as a whole unspent battery. That is, a battery is counted as either spent (0) or unspent (1). Unspent can be taken to mean 'not entirely used up'.
For brevity, let's just skip right ahead to having 1001 full batteries at mile marker 533. Load 1000 batteries in the car and every half mile, switch to an unused battery. When we get to the destination, we will have 1000 unspent batteries (934 will have half their juice and 66 will have all their juice).
|
Posted by Guest
on 2007-08-17 15:44:37 |