I'm not sure if u have seen this website http://mathproblems.info/working.php#s99 but i wonder if there is a better way to solve this problem using maple:
It is your task to deliever as much grain as possible from city A to city B. The cities are 1,000 miles apart. You initially have 10,000 pounds of grain. Your camel may carry up to 1,000 pounds and eats 1 pound of grain per mile traveled. You may leave grain along the way and return to it later. How much grain can you deliever to city B?
Ans 1399.77 pounds of grain.