\(C=-x^2-y^2+xy+2x+2y\Leftrightarrow2C=-2x^2-2y^2+2xy+4x+4y=-\left(x^2-2xy+y^2\right)-\left(x^2-4x+4\right)-\left(y^2-4y+4\right)+8=-\left[\left(x-y\right)^2+\left(x-2\right)^2+\left(y-2\right)^2\right]+8\le8\)\(\Rightarrow C\le4\)
Dấu đẳng thức xảy ra <=> x = y = 2
Vậy \(MaxC=4\Leftrightarrow x=y=2\)