Let $a,b$ be given integers and $gcd(a,b)|n$, which implies by a theorem that I have that there are some integers $x_0,y_0$ such that $n=ax_0+by_0$. Moreover, suppose that $x,y$ are two other integers such that $n=ax+by$.
I need to show that $x$ has the form $x_0+\frac{tb}{gcd(a,b)}$ and $y$ has the form $y_0-\frac{ta}{gcd(a,b)}$ for some appropriate choice of integer $t$. I was given the hint to prove this by contradiction but I saw absolutely no path forward using that.
Since $n=ax_0+by_0=ax+by$ I can infer $a(x-x_0)=-b(y-y_0)$. I can also see that my goal amounts to proving the existence of an integer $t$ such that
$$(x-x_0)\cdot gcd(a,b) = tb\\ (y-y_0)\cdot gcd(a,b)=-ta$$
This vaguely resembles the statement that $b$ divides the left-hand side of the first equation, and likewise for $a$, although it's a little more than that. One thing that comes to mind is that $|ab| = gcd(a,b)lcm(a,b)$ but I'm not seeing how I could use that. Thought about maybe arguing that since $a(x-x_0)=-b(y-y_0)$ then either $b|a$ or $b|x-x_0$ but that only holds for prime $b$.
Any help would be appreciated.