To get the answer, you need to think of it like a see-saw.
Both sides must equal the same relative to 33.5. For example, 32 is 1.5 away from 33.5 so you could say you have 1.5*4 (because theres 4 tubes with 32 sweets). If you were to do this for the whole table, it would look something like this:
[tex](1.5*4)+(0.5*x)=(0.5*9)+(1.5*1)+(2.5*1)[/tex]
This simplifies to:
[tex]6+0.5x=8.5[/tex]
[tex]0.5x=2.5[/tex]
[tex]x= \frac{2.5}{0.5}[/tex]
[tex]x=5[/tex]
This method can sometimes be inefficient depending on how many values but is probably the simplest way to solve this problem.
hope this helps :)
(sorry the other way is kinda hard to explain possibly ask your teacher tomorrow)