5. Find all values of $a$, for each of which the system

$$
\left\{\begin{array}{l}
|y|+|y-x| \leqslant a-|x-1| \\
(y-4)(y+3) \geqslant(4-x)(3+x)
\end{array}\right.
$$

has exactly two solutions.
# Problem 5.

Answer: when $a=7$.

Solution. By the triangle inequality:

$$
|y|+|y-x|+|x-1| \geqslant|y-(y-x)-(x-1)|=1
$$

therefore, the first inequality can have solutions only when $a \geqslant 1$. In this case, it is equivalent to the system of inequalities

$$
-\frac{a-1}{2} \leqslant y \leqslant \frac{a+1}{2}, \quad-\frac{a-1}{2} \leqslant x \leqslant \frac{a+1}{2}, \quad x-\frac{a+1}{2} \leqslant y \leqslant x+\frac{a-1}{2}
$$

which defines a hexagon on the coordinate plane if $a>1$, and a triangle if $a=1$.

The second inequality of the system is equivalent to the inequality $(x-0.5)^{2}+(y-0.5)^{2} \geqslant 49 / 2$ and thus defines the complement to the entire plane of the interior of a circle with center $(1 / 2,1 / 2)$ and radius $7 / \sqrt{2}$.

If $a=1$, the system has no solutions.

Since for $a>1$ the vertices $\left(-\frac{a-1}{2},-\frac{a-1}{2}\right)$ and $\left(\frac{a+1}{2}, \frac{a+1}{2}\right)$ of the larger diagonal of the hexagon are the farthest from the point $(1 / 2,1 / 2)$ among all points of the hexagon, the intersection of the considered sets will consist of exactly two points if and only if the circle of the second set passes through these vertices. The point $(1 / 2,1 / 2)$ is the midpoint of the larger diagonal, and the length of this diagonal is $a \sqrt{2}$. Therefore, $a \sqrt{2}=14 / \sqrt{2}$, i.e., $a=7$.