Say you bought 6 lollies and 3 ice creams for 8.52 and 3 ice creams and 6 drinks for 9.24. You have bought a total of 6 lollies, 6 ice creams, and 6 drinks and you spent a total of 9.24+8.52=17.76.

We can then say that buying 6 lollies, 6 ice creams, and 6 drinks cost 17.76. If we divide by six, we can say that 1 lolly, 1 ice cream, and 1 drink cost 2.96