You are sent to the market by your father with 800 dollars, and told to buy 100 animals. When you arrive at the market, you find out that pigs cost 8 dollars each, so it would be easy to follow your father's instructions.
However, you see that there are only 99 pigs for sale. The only other animals there are chickens for 1 dollar each, and cows for 80 dollars each.
If there are enough chickens and cows for you to buy as many as you wanted, how can you end up buying 100 animals using exactly 800 dollars?
It seems like no one else published this solution yet:
You'd like to have bought 100 pigs, since that comes out to exactly 100 animals for 800 dollars, but you can't.
So instead, note for each pig you replace with a cow, you're spending 72 more dollars. For each pig you replace with a chicken, you're spending 7 fewer dollars.
Thus simply replace 72 pigs with chickens (costing 7*72 less) and 7 cows (costing 72*7 more), and the other 21 animals remain as pigs.

Posted by Gamer
on 20110102 19:54:07 