To solve the following equation $$32x - 18y = 40$$, I first found the GCD like that: $$32 = (-18)(-1) + 14 $$ $$-18 = (14)(-1) - 4 $$ $$14 = (-4)(-3) + 2 $$ $$-4 = (2)(-2) + 0 $$
Therefore, I found 2. But these negative values are confusing, because I don't know if they are allowed there, even though I can find a solution to the equation if I proceed with the calculations:
$$ 2 = (14) - (-4)(-3) $$ $$ 2 = (14) - (-18-14(-1))(-3) $$ $$ 2 = (14) - 18(3)+14(3) $$ $$ 2 = (32-(-18)(-1)(4)) - (18)(3) $$ $$ 2 = 32(4) - (-18)(-4) - (18)(3) $$ $$ 2 = 32(4) - (18)(7) $$ $$ 40 = 32(80) - (18)(140) $$ Therefore, I have $$x_0 = 80, y_0 = 140$$ as particular solution, and $$x = 80 + 9n, y = 140 + 16n, n \in \mathbb{Z}$$ as a complete solution.