When the bakery bakes cakes, they divide them into packages of 6 and 12 pieces. They make a profit of 4 Kč from selling a six-piece package and 9 Kč from selling a twelve-piece package. What is the maximum and minimum number of cakes that can be on one baking tray if the profit from their sale is 219 Kč?

(M. Dillingerová)
Large packages (à 12 cakes with a profit à 9 crowns) will be $x$, small packages (à 6 cakes with a profit à 4 crowns) will be $y$. It must hold that

$$
9 x+4 y=219
$$

- Large packages à 9 crowns can be at most 24 (the profit will then be $24 \cdot 9=216$, leaving 3, which cannot be obtained in increments of 4 crowns).
- Large packages à 9 crowns can be at most 23 (then the profit will be $23 \cdot 9=207$, leaving 12, which are 3 small packages of 4 crowns each).

We will conduct the entire investigation this way. The minimum number of cakes on the tray will be 294 (23 large packages and 3 small ones), and the maximum will be 324 cakes (3 large packages and 48 small ones).