Solution: If the water in barrel B is poured into barrel A, after barrel A is full, barrel B still has 10 liter of water.
So the total water number is equal to X+ 10.
If all the water in barrel A is poured into barrel B, barrel B can only hold 20 liters of water.
X+ 10+20=Y
X-Y+30=0