<s>[INST] JBMO TST macedonia Number Theory 
Find all $x,y$ positive integers $$x + y^2 + (\gcd(x, y))^2 = xy \cdot
 \gcd(x, y)$$

I tried supposing $\gcd(x,y)=d$ and letting $x=ad$, $y=bd$ but didn't get anything the closest thing I think is usefull that $(b+1)^2+4a^2b$ is a perfect square. 
 [/INST] Your start is very good. Now you have $$ad+b^2d^2+d^2=abd^3$$ thus $$a+db^2+d=abd^2\implies d\mid a$$ so $a=dc$ for some integer $c$ and now we have: $$c+b^2+1=cbd^2$$
From here we have $$c={b^2+1\over bd^2-1}\implies \boxed{bd^2-1\mid b^2+1}$$
Now we have $$\color{red}{bd^2-1}\mid (b^2+1)d^2-(bd^2-1)b =\color{red}{ d^2+b }$$
From here we deduce $$bd^2-1\leq d^2+b\implies d^2\leq {b+1\over b-1}$$ 
if $b\ne 1$. Now if $b\geq 2 $ we get $d^2\leq 3$ so $d=1$ and so $$b-1\mid b^2+1 \implies b-1 \mid (b^2+1)-(b^2-1)=2$$
This means $b = 2=y$ so $a=5=x$ or   $b=3=y$ and $a=5=x$.
If $b=1$ we get from boxed relation $d-1\mid 2$ so $d=2$ or $d=3$...
</s>