Explanation:
Let's assume that Andrew had $5x at first, and Paul had $2x.
After Andrew gave $30 to Paul, Andrew has $5x-$30, and Paul has $2x+$30.
We are told that they had an equal amount of money each after the transaction. This means:
5x - 30 = 2x + 30
Solving for x, we get:
3x = 60
x = 20
So Andrew had $5x = $100 at first, and Paul had $2x = $40.
After the transaction, Andrew had $100-$30 = $70, and Paul had $40+$30 = $70.
Together, they had $70+$70 = $140.
Therefore, they had $140 altogether.