On a road trip, N people pay for fuel. Each pays a different amount. At the end of the trip, calculate the minimum number of transactions so that each person has paid the same amount.
e.g. on the road trip, these people pay for fuel
- Dave - $50
- John - $25
- George - $5
- Barry - $0
After the road trip:
- Barry pays Dave $20
- George pays John $5
- George pays Dave $10
Added: The output of the program should list the transactions.
Bonus points if the solution is written in Visual Basic.