B4. The candy store sells chocolates in the flavors white, milk, and dark. You can buy them in three different colored boxes. The three colored boxes have the following contents:

- Gold: 2 white, 3 milk, 1 dark,
- Silver: 1 white, 2 milk, 4 dark,
- Bronze: 5 white, 1 milk, 2 dark.

Lavinia buys a number of chocolate boxes (at least one) and upon returning home, it turns out she has exactly the same number of chocolates of each flavor.

What is the minimum number of boxes Lavinia could have bought?
B4. 20

Suppose Lavinia buys $a$ golden boxes, $b$ silver ones, and $c$ bronze ones. Then we can describe the problem we want to solve using the following equations:

$$
2 a+b+5 c=3 a+2 b+c=a+4 b+2 c .
$$

The first equation $2 a+b+5 c=3 a+2 b+c$ can be rewritten as $4 c-b=a$. Substituting this expression for $a$ into the second equation, we get

$$
13 c-b=3 b+6 c .
$$

This can be simplified to $7 c=4 b$. The number 7 is prime, which means that $b$ must be divisible by 7 (since 4 is not divisible by 7). We write $b=7 k$, where $k$ is an integer. From this, it follows that $c=\frac{4}{7} b=4 k$ and $a=4 \cdot 4 k-7 k=9 k$. We see that $a, b$, and $c$ are as small as possible when $k$ is as small as possible. Lavinia buys at least one box of chocolates, so $k=1$ and we get $a=9, b=7$, and $c=4$. We see that Lavinia has 45 chocolates of each flavor. In total, she bought at least $9+7+4=20$ boxes.