The exact recipe of what I did: Let $ p = x^{2} + 1337 $, $ q = y^{2} + 1187 $, $ (z^{2} + 1337)(z^{2} + 1187) - n = 0 $.Then, you can solve for $x$, $y$, $p$, and $q$ based on \\[ xy = \sqrt{n - 1337\cdot 1187 - 1187z^{2} - 1337z^{2}} + \mathrm{diff} \\]\\[ 1187x^{2} + 1337y^{2} = n - 1337 \cdot 1187 - (xy)^{2} \\]where diff ranges from $-10000$ to $10000$.
