A group of boys and girls went out to eat pizza for two consecutive days. At the restaurant they went to, the pizzas are cut into twelve equal slices. Maria observed that on the first day, each boy ate 7 slices, and each girl 3 slices. On the second day, each boy ate 6 slices, and each girl 2 slices. Interestingly, on both days they ordered four pizzas that were completely consumed, and then ordered another one, from which some slices were left (that is, at least one slice was eaten and at least one slice was left). How many boys and girls went to the pizzeria?
Solution

Let $x$ and $y$ be the number of boys and girls, respectively. We know that the total number of slices consumed was at least 49 (4 pizzas and one slice of the last pizza) and at most 59 (4 pizzas plus 11 slices, remember that at least one slice of the last pizza was left). On the other hand,

$$
\begin{aligned}
& 7 x+3 y \leq 59 \\
& 6 x+2 y \geq 49
\end{aligned}
$$

Multiplying the last equation by -1, we need to switch the inequality, resulting in

$$
\begin{aligned}
7 x+3 y & \leq 59 \\
-6 x-2 y & \leq-49
\end{aligned}
$$

Adding the two inequalities, we get

$$
x+y \leq 10
$$

Substituting into the second inequality, we have

$$
4 x+10+10 \geq 4 x+(x+y)+(x+y)=6 x+2 y \geq 49
$$

Thus, $4 x \geq 29$, and therefore $x \geq 8$. On the other hand, from the first equation, we have

$$
7 x \leq 7 x+3 y \leq 59
$$

Therefore, $7 x \leq 59$, which implies $x \leq 8$. Hence, $x=8$ and substituting, we get

$$
3 y \leq 3 \quad \text { and } \quad 2 y \geq 1
$$

This gives us $y=1$. Therefore, there were 8 boys and 1 girl at the pizzeria.