First, let's make a variable to represent the total amount of money each spent.
How about 'r'?
Since they both spent the same amount of money, you can represent the money they have left with these two equations:
49 - r
45 - r
Because one has 3 times more than the other, it can be represented like this:
49 - r = 3(45 - r)
49 - r = 135 - 3r
Subtract 49 from both sides:
-r = 86 - 3r
Add 3r to both sides:
2r = 86
r = 43
They've both spent Rs 43
Good luck!