this may help you
Use an arbitrary mass, 100 g is an easy number to work with.
60% of 100 g is 60 g, there are two A's. Each A is 30 g
40 g is B, and there is only one, so B is 40 g.
AB2, would have a mass of 30 g + 2*40 g = 110 g
The new percent by mass composition of A is: 30g110g∗100%=27.3%
The new percent by mass composition of B is: 80g110g∗100%=72.7%