Question:
At first, the ratio of the number of marbles in Bag A to the number of marbles in Bag B was 4 : 5. After Zachary took out 16 marbles from Bag A and took out 30 marbles from Bag B, the ratio of the number of marbles in Bag A to the number of marbles in Bag B was 8 : 9.
(a) How many marbles were there in Bag B at first?
(b) How many marbles were there altogether in the end?

Solution:
