\[x - было\ в\ первой\ партии;\ \ \ \]
\[y - было\ во\ второй\ партии.\]
\[1,2x - стало\ в\ первой\ партии;\ \ \]
\[0,7y - стало\ во\ второй\ партии.\]
\[\left\{ \begin{matrix} x + y = 50\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\ 1,2x + 0,7y = 50 - 5 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} x + y = 50\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\ 1,2x + 0,7y = 45\ \ | \cdot 10 \\ \end{matrix} \right.\ \]
\[\left\{ \begin{matrix} x + y = 50\ \ \ | \cdot 7 \\ 12x + 7y = 450 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} 7x + 7y = 350\ \ \ \ \ (1) \\ 12x + 7y = 450\ \ \ (2) \\ \end{matrix} \right.\ \text{\ \ \ \ }\]
\[(2) - (1):\ \ 5x = 100 \Longrightarrow x = 20\]
\[\left\{ \begin{matrix} x = 20\ \ \ \ \ \ \ \ \ \ \\ 20 + y = 50 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} x = 20 \\ y = 30 \\ \end{matrix} \right.\ \]
\[1,2x = 1,2 \cdot 20 = 24.\]
\[0,7y = 0,7 \cdot 30 = 21.\]
\[Ответ:\ \ 24\ депутата\ \]
\[и\ 21\ депутат.\]