Skip to main content
OlympiadHQ

Browse · MathNet

Print

Estonian Mathematical Olympiad

Estonia number theory

Problem

In an unopened pack, there are red, green and blue candies that weigh g, g and g respectively. There are the same number of candies of each color. After Mary eats some candies from that pack, the remaining candies weigh exactly g in total. Find the least number of candies that Mary could have eaten.
Solution
Let there be candies of each color in the unopened pack. Since one red, one green and one blue candy weigh grams in total, the total weight of all candies in the unopened pack is grams. Therefore Mary eats or grams of candies.

Note that if , then Mary could have eaten grams of candy by eating blue and red candy, for a total of candies. We will show that this is the minimum possible number of candies by considering all possible cases:

If , then grams can only be achieved by eating green and red candies, which is more than candies. If , then Mary ate grams of candy. If Mary ate a blue candy, then the rest of the lighter candies had to weigh grams. For that, at least lighter candies are needed, since up to lighter candies weighs at most grams. If Mary did not eat a blue candy, then she had to eat at least lighter candies, since up to lighter candies weighs at most grams. Either way, the amount of candies needed is greater than . If , then Mary ate grams of candy. If Mary ate , or blue candies, then the rest of the lighter candies had to weigh , or grams respectively. In the last case, at least lighter candies are needed, since up to lighter candies weighs at most grams; in the first and second case even more lighter candies are obviously needed. Hence more than candies would have been eaten. If , then Mary ate grams of candy, so she needed to eat more than candies, since any candies weigh at most grams. If , then the total weight of candies eaten is even greater and hence more than candies had to be eaten.

Since in all cases at least candies had to be eaten, is the least number of candies that Mary could have eaten.

---

Alternative solution.

Since one red, one green and one blue candy weigh grams in total and there are the same amount of each color candies in the pack, the total weight of the candies is a multiple of .

Suppose Mary ate candies. Note that is possible, since if there were candies of each color in the original pack, the total weight of the candies was grams and Mary could have eaten three blue candies and one red candy with a combined weight of grams, leaving grams of candy in the pack.

Let us show that cannot be less than .

If , then Mary would have eaten either one red, one green or one blue candy. In that case, the total weight of candies in the unopened back would have been , or grams. Since none of these are divisible by , they cannot be the original weight of the pack, so is not possible. If , then Mary would have eaten either two red, two green, two blue, one red and one green, one green and one blue or one red and one blue candy. Then the original total weight of the candies would have been , , , , or grams respectively. Since none of these are divisible by , is not possible either. * If , then Mary would have eaten either three red, three green, three blue, one red and two green, one red and two blue, one green and two red, one green and two blue, one blue and two red, one blue and two green, or one red, one green and one blue candy. Then the original total weight of the candies would have been , , , , , , , , or grams respectively. Since none of these is divisible by , is not possible either.

Hence the least number of candies eaten is .
Final answer
4

Techniques

Modular Arithmetic