Two men are sharing a meal. The first man had five loaves of bread, and the second had three. They invite Ali (a mathematician), who had no bread, to share their meal. Together, they eat all 8 loaves, sharing equally. Ali gave the men eight coins as a thank you. The first man said that he would take five of the coins and give his partner three, but the second man refused and asked for the half of the sum (i.e. four coins) as an equal division. The first one refused. They ask Ali for a fair solution. What did he tell them to do?
Ali said that the man who contributed five loaves should get seven coins and the man who contributed three should get one coin. This is because the three loaves contributor ate 2 2/3 loaves and contributed 1/3 of a loaf to Ali while the contributor of five loaves also ate 2 2/3 loaves but contributed 1 2/3 = 7/3 loaves to Ali.