Let x be the cost of a kilogram of jelly beans and y the cost of a kilogram of gummy worms. We form two equations:
2x+2y=32
2x+y=25
We have a system of equations now and we solve for x and y.
Subtracting 2x+y=25 from 2x+2y=32, we get y=7. Then we plug the y value into 2x+y=25 to get the value of x.
2x+y=25
2x+7=25
2x=18
x=9.
Therefore jelly beans cost $9 per kilogram and gummy worms $7 per kilogram.