\(5\left(a^2+ab+b^2\right)=19\left(a+b\right)\) (1)
\(\Leftrightarrow5a^2+\left(5b-19\right)a+5b^2-19b=0\)
\(\Delta=\left(5b-19\right)^2-20\left(5b^2-19b\right)=-75b^2-190b+741\ge0\)
\(\Rightarrow b=\left\{-4;-3;-2;-1;0;1;2\right\}\)
Thế vào (1) ta được \(\left(a;b\right)=\left(0;0\right);\left(2;3\right);\left(3;2\right)\)
\(\Rightarrow P=\left\{0;7;8\right\}\Rightarrow P_{max}=8\)