4.1. A batch of tablets from four different brands was delivered to a computer store. Among them, Lenovo, Samsung, and Huawei tablets made up less than a third, with Samsung tablets being 6 more than Lenovo. All other tablets were Apple iPads, and there were three times as many of them as Huawei. If the number of Lenovo tablets were tripled, and the number of Samsung and Huawei tablets remained the same (with the total number of all tablets unchanged), then there would be 59 Apple iPads. How many tablets were delivered to the store in total?
Answer: 94.

Solution. Let $n$ be the total number of tablets we are looking for, with $x$ being the number of Lenovo brand tablets, and $y$ being the number of Huawei brand tablets. Then the number of Samsung tablets is $x+6$, and the number of Apple iPad tablets is $n-2x-y-6=3y$. From the problem statement, we also have the equation $4x+y+6=n-59$. From these two equations, we find $x=\frac{3n-254}{14}$ and $y=\frac{n+53}{7}$. Since $x \geqslant 1$, we get $3n-254 \geqslant 14$, which leads to $n \geqslant \frac{268}{3}=89 \frac{1}{3}$. On the other hand, from the problem statement, we also have the inequality $2x+y+6<\frac{n}{3}$, which gives $\frac{33-254}{7}+\frac{n+53}{7}+6<\frac{n}{3}$, or $n<\frac{477}{5}=95 \frac{2}{5}$. Additionally, since $n+53$ is divisible by 7, the number $n$ gives a remainder of 3 when divided by 7. Among the integers from 90 to 95, there is only one such number, namely $n=94$.