1.1. A ballpoint pen costs 10 rubles, a gel pen costs 50 rubles, and a fountain pen costs 80 rubles. What is the maximum number of gel pens that can be bought given that exactly 20 pens must be purchased in total, and among them there must be pens of all three types, and exactly 1000 rubles must be spent on them?
Answer: 13. Solution. If $x$ ballpoint pens, $y$ gel pens, and $z$ fountain pens are bought, then we have two equations: $x+y+z=20 ; 10 x+50 y+80 z=1000$ (or $x+5 y+8 z=100$ ). Subtracting the first equation from the second, we get $4 y+7 z=80$. It follows that $z$ must be divisible by 4, i.e., $z=4 n$. Therefore, $4 y+7 \cdot 4 n=80$, i.e., $y=20-7 n$. Accordingly, $x=20-y-z=3 n$. Positive solutions are obtained when $n=1$ and $n=2$. In the end, the solutions are two sets of integers: $(3,13,4)$ and $(6,6,8)$. The largest possible $y$ is 13.