I just read a story relating to the knowledge and wisdom gained through pious company, in this case of Noble Ali Ra in the company of the Prophet Sallallahu alaihi wasalam.
Two friends were sharing some food one had 3 pieces the other 5 pieces of roti (bread). A traveller passed by and they asked him to join in the meal and they shared the bread between the three of them. The next day the traveller left and he gave them 8 dirhams for the bread. One of the friends said as he had provided 5 rotis he should receive 5 dirhams and the other 3. The other friend said that it would be fair to split the money 50/50 i.e. 4 dirhams each.They could not reach an agreement and to reach an agreement and make peace they visited hazrat Ali Radhiallahu anho.
Hazrat Ali RA decided that the person with 5 rotis should receive 7 dirhams and the other person just one dirham. The people were a little confused as to why this was the case. it was explained to them that each piece of bread should be divided in to three thus 8 x 3 = 24 pieces of bread. it would be assumed the food was shared equally thus each would eat 8 of these pieces. This meant thatt he person who provided 3 rotis would have eaten himself 8 out of his 9 pieces and the guest would have eaten just one of his pieces. The person who provided 5 rotis would have eaten 8 out of his 15 pieces and 7 pieces would have been eaten by the guest and thus he should receive 7 pieces.
Subhanallah at the Adl (insaaf) of Hazrat Ali RA.