\(a,P=\left[\left(x^2-4xy+4y^2\right)+10\left(x-2y\right)+25\right]+\left(y^2-2y+1\right)+2016\\ P=\left[\left(x-2y\right)^2+10\left(x-2y\right)+25\right]+\left(y-1\right)^2+2016\\ P=\left(x-2y+5\right)^2+\left(y-1\right)^2+2016\ge2016\\ P_{min}=2016\Leftrightarrow\left\{{}\begin{matrix}x=2y-5\\y=1\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x=2\cdot1-5=-3\\y=1\end{matrix}\right.\)
\(b,Q=\left[\left(-x^2+2xy-y^2\right)-2\left(x-y\right)-1\right]-\left(y^2-12y+36\right)+42\\ Q=-\left(x-y\right)^2-2\left(x-y\right)-1-\left(y-6\right)^2+42\\ Q=-\left(x-y+1\right)^2-\left(y-6\right)^2+42\le42\\ Q_{max}=42\Leftrightarrow\left\{{}\begin{matrix}x=y-1\\y=6\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x=5\\y=6\end{matrix}\right.\)