Then b bought it (100-x)
6x+9( 100-x)=780
6x+900-9x=780
-3x=- 120
x=40
B purchase: 100-x=60 bottles.
Your second question didn't say that you spent a lot of money.
Do the math.