Program to calculate the individuals share accumulated during a trip spent by a group of friends where each expense was shared by a different sub-group and paid for by individuals.
A group of 6 friends, Alex, Bob, Charlie, Dexter, Etan and Falco, went on a vacation. Expenses;
- Hotel stay, $3,000, shared by entire group, paid for by Alex. (everyone owes Alex $500)
- Car rental, 2 cars for $300 each, shared by entire group, paid for by Bob and Charlie. (Alex owes nothing, Bob and Charlie now only owe $400 to Alex, and everyone else owes $500 to Alex and $50 to Bob and $50 to Charlie)
- Second day brunch in a restaurant $150, shared by Dexter, Etan and Falco, Paid for by Falco. (Dexter and Etan now owe an additional $50 to Falco).