## Task B-1.1.

Determine all ordered pairs of integers $(a, x)$, for which

$$
2|x-1|+a|x-3|=3a+5-x
$$
## Solution.

First case. If $x \leqslant 1$, the initial equation transforms into

$$
\begin{gathered}
2(-x+1)+a(-x+3)=3 a+5-x \\
-x(a+1)=3 \\
x=\frac{-3}{a+1}
\end{gathered}
$$

This expression will be an integer only if $a+1 \in\{-3,-1,1,3\}$, which means $a \in\{-4,-2,0,2\}$. Since $x \leqslant 1$, the only possible solutions are:

for $a=-4, x=1, \quad$ for $a=0, x=-3, \quad$ for $a=2, x=-1$.

Second case. If $x > 3$, the initial equation transforms into

$$
\begin{gathered}
2(x-1)+a(x-3)=3 a+5-x \\
x(3+a)=6 a+7 \\
x=\frac{6 a+7}{a+3}=\frac{6(a+3)-11}{a+3}=6-\frac{11}{a+3} .
\end{gathered}
$$

This expression will be an integer only if $a+3 \in\{-11,-1,1,11\}$, which means $a \in\{-14,-4,-2,8\}$. Since $x>3$, the only possible solutions are:

for $a=-14, x=7, \quad$ for $a=-4, x=17, \quad$ for $a=8, x=5$.

Finally, the desired ordered pairs $(a, x)$ are $(-14,7),(-4,1),(-4,17),(0,-3),(2,-1),(8,5)$.