Problem 4.2. Petya took half of the candies from the box and put them in two pockets. Deciding that he took too many, Petya took out 6 candies from each pocket and put them back into the box. By how many more candies did the box have than Petya's pockets?
Answer: 24.

Solution. Let $x$ be the number of candies in one of Petya's pockets before he returned some of the candies to the box. At that moment, there were $2 x$ candies in the box.

After Petya took out 6 candies from each pocket, he had

$$
(x-6)+(x-6)=2 x-12 \text{ candies }
$$

and there were $2 x+12$ candies in the box.

Thus, there were $(2 x+12)-(2 x-12)=24$ more candies in the box than Petya had.