There were some pink erasers and blue erasers. The erasers were packed into 2 bags. At first, Bag A contained 480 erasers and 40% of them were blue erasers. Bag B contained 300 erasers and 80% of them were blue erasers. How many pink erasers and blue erasers in total must be moved from Bag A to Bag B such that 20% of the erasers in Bag A are pink and 50% of the erasers in Bag B are blue?

number of pinks A --- p

number of blues in A --- b
p + b = 480
b : p = 40:60 = 2 : 3
b/p = 2/3
b = 2p/3
p + 2p/3 = 480
3p + 2p = 1440
p = 288 , then b = 192

In B

number of pinks in B --- x
number of blues in B ---- y
x+y = 300
y = .8(300) = 240 , then x = 60

so we have
A: contains 288 pink and 192 blue
B: contains 60 pink and 240 blues

the removal episode:
number of pinks removed from A --- a
number of blues removed from A --- b

content of A: 288-a pinks, and 192 - b blues
"20% of the erasers in Bag A are pink", so 80% of them must be blue
20% : 80% = 1:5
(288-a) : (192-b) = 1:5
(288-a) / (192-b) = 1/5
192-b = 1440-5a
5a - b = 1248 , #1

content of B: 60+a are now pink, 240+b are now blue
"50% of the erasers in Bag B are blue?" <---- they are equal
60+a = 240+b
a - b = 180 , #2

subtract #1 and #2
4a = 1068
a = 267 , then b = 87

Whewww!

check:
current content of A: pinks 288-267 = 21, blues 105
ratio: pink:blue = 21:105 = 1:5 = 20% : 80% , CHECK!

current content of B: pinks 60+267 = 327, blues 240 + 87 = 327
they are equal? CHECK:

So how many pink erasers and blue erasers in total must be moved from Bag A to Bag B such that 20% of the erasers in Bag A are pink and 50% of the erasers in Bag B are blue??