Given a positive integer number $a$ and two real numbers $A$ and $B$, find a necessary and sufficient condition on $A$ and $B$ for the following system of equations to have integer solution: \[ \left\{\begin{array}{cc} x^2+y^2+z^2=(Ba)^2\\ x^2(Ax^2+By^2)+y^2(Ay^2+Bz^2)+z^2(Az^2+Bx^2)=\dfrac{1}{4}(2A+B)(Ba)^4\end{array}\right. \]
Problem
Source: China Mathematical Olympiad 1990 problem4
Tags: algebra, system of equations, number theory unsolved, number theory