\(-x^2+2xy-4y^2+2x+10y-8\)
\(=-\left(x^2+2xy+y^2\right)-3y^2+2x+10y-8\)
\(=-\left(x-y\right)^2+2x-2y+12y-3y^2-8\)
\(=-\left(x-y\right)^2+2\left(x-y\right)-1+12y-3y^2-7\)
\(=-\left[\left(x-y\right)^2-2\left(x-y\right)+1\right]+12y-3y^2-7\)
\(=-\left(x-y-1\right)^2-3\left(y^2-4y+4\right)+5\)
\(=-\left(x-y-1\right)^2-3\left(y-2\right)^2+5\le5\)
\("="\Leftrightarrow\left\{{}\begin{matrix}x=3\\y=2\end{matrix}\right.\)