This problem can be solved by the system and where a represents the amount of money that Andy spent, and b represents the amount of money that Barry spent.