Two brothers share a flock of x sheep. They take the sheep to the market and sell each sheep for $x. At the end of the day they put the money from the sales on the table to divide it equally. All money is in $10 bills, except for fewer than ten excess $1 bills. One at a time they take out $10 bills. The brother who draws first also draws last.
The second brother complains about getting one less $10 bill so the first brother offers him all the $1 bills. The second brother still received a total less than the first brother so he asks the first brother to write him a check to balance the things out.
How much was the check?
I am assuming that x in this question is a constant. In other words, each sheep is sold for an amount of dollars equal to the amount of sheep in the flock. I am also assuming that all of the sheep were sold. They must then get a nice turnover of x*x (square of x)
To work out the size of the check:
y = remainder of sqr(x)/10 or y = sqr(x) mod 10
check = (10 - y)/2
Then there's also that weird all end on six thing in Nikki's answer, which is great.
Edited on October 7, 2003, 3:01 am
Edited on October 7, 2003, 3:02 am