In the city is $3$ types of hotels. In the $I$ type there is $150$ basic apartments and $17$ luxury apartments, in the $II$ type $310$ - basic and $37$ - luxury and in the last $III$ type $40$ - basic and $5$ - luxury. In the city hotels there is total $1040$ basic apartments and $123$ luxury apartments. I need to find, how much of each type of hotel there is in the city, if generally there is less than $10$ hotels.
I tried to make system of $2$ equations with $3$ variables, but then I get stuck, if there would be able to make $3$ equations I could eliminate $1$ variable, but now I have only $2$ and I don't know what to do next.
If there is any other way to solve the problem it fits for me.
Let $a$ be the number of type I hotels, $b$ the number of type II hotels and $c$ the number of type III hotels. Then: \begin{cases}(1)\quad150a+310b+40c=1040\\(2)\quad 17a+37b+5c=123\\(3)\quad a+b+c<10\end{cases} Manipulating $(1)$ and $(2)$ will give you a relation between $b$ and $c$ (for example), but you won't have enough information to determine $a$. However, you can then use $(3)$ to put some upper bound on $a$, plus the fact that $a$ is an integer.
Then you should find a set (perhaps a singlet) of possible values.$\color{red}{\text{Then you should find a unique solution.}}$As you (correctly) figured it out, we get the following relations from $(1)$ and $(2)$: $$a=4-b\quad\text{and}\quad 4b+c=11$$ which we can rearrange to get: $$b=4-a\quad\text{and}\quad c=4a-5$$ $(3)$ now becomes: $$a+b+c<10\Longleftrightarrow a+4-a+4a-5<10\Longleftrightarrow a<\dfrac{11}{4}$$ And since $a$ must be an integer, this is equivalent to $a\le 2$.
But we've just shown that $c=4a-5>0$, which in turn gives that $a>\frac{5}{4}$, i.e. $a\ge 2$. Thus, the only way to satisfy both conditions on $a$ is to have $a=2$. Then it follows that $b=2$ and $c=3$.
Thus there is a unique solution: $(a,b,c)=(2,2,3)$.