4. Little One gave a big box of candies to Karlson. Karlson ate all the candies in three days. On the first day, he ate 0.2 of the entire box and 16 more candies. On the second day, he ate -0.3 of the remainder and 20 more candies. On the third day, he ate -0.75 of the remainder and the last 30 candies. How many candies were in the box?
Solution. Let $x$ be the number of candies in the box. On the first day, $(0.2x + 16)$ candies were eaten; on the second and third days, $(0.8x - 16)$ candies were eaten. On the second day, $(0.3(0.8x - 16) + 20) = (0.24x + 15.2)$ candies were eaten; on the third day, $(0.56x - 31.2)$ candies remained. Since on the third day, 0.75 of the remainder and another 30 candies were eaten, the remainder will be 120 candies. We get the equation $0.56x - 31.2 = 120$, from which we find $x = 270$.

Answer: 270 candies.