5. (10 points) Find all values of parameters $k$ and $n$ for which the system of equations has infinitely many solutions.

$$
\left\{\begin{array}{c}
k y + x + n = 0 \\
|y-2| + |y+1| + |1-y| + |y+2| + x = 0
\end{array}\right.
$$

Solution:

It is convenient to introduce a coordinate system, directing the Ox axis upwards and the Oy axis to the right. We divide the Oy axis at points $-2, -1, 1, 2$ into intervals. On each interval, we obtain a specific system and find the values of the parameters for which the lines have infinitely many points of intersection.

$$
\begin{aligned}
& \text { 1) }\left\{\begin{array}{c}
y \leq -2 \\
x = 4y \\
k y + x + n = 0
\end{array} \quad \Rightarrow n=0, k=-4\right. \\
& \text { 2) }\left\{\begin{array}{c}
-2 < y < -1 \\
x = 2y - 4 \\
x = -k y - n
\end{array} \Rightarrow k=-2, n=4\right. \\
& \text { 3) }\left\{\begin{array}{c}
-1 \leq y \leq 1 \\
x = -6 \\
x = -k y - n
\end{array} \Rightarrow n=6, k=0\right. \\
& \text { 4) }\left\{\begin{array}{l}
1 < y < 2 \\
x = -4 - 2y \\
x = -k y - n
\end{array} \Rightarrow k=2, n=4\right. \\
& \text { 5) }\left\{\begin{array}{c}
y \geq 2 \\
x = -4y \\
x = -k y - n
\end{array} \quad \Rightarrow k=4, n=0\right.
\end{aligned}
$$
Answer: $(k ; n)=(4 ; 0) ;(-4 ; 0) ;(2 ; 4) ;(-2 ; 4) ;(0 ; 6)$