Problem

Source: 2022 Bulgarian Spring Math Competition, Problem 10.1

Tags: system of equations, Inequality, algebra



If $x, y, z \in \mathbb{R}$ are solutions to the system of equations $$\begin{cases} x - y + z - 1 = 0\\ xy + 2z^2 - 6z + 1 = 0\\ \end{cases}$$what is the greatest value of $(x - 1)^2 + (y + 1)^2$?