Solving $12x \equiv 20 \pmod{38}$ $12x \equiv 20 \pmod{38}$
$gcd(12,38)=2$ using Euclidean Algorithm.
There is a solution since $2|20$.
Use the Extended Euclidean Algorithm $2=12*-3 +1*38$
Then $20=2*10=12*-3*10+1*38*10$ so $x=-3*10=-30$ is a solution.
General solution: $x=-30+19t$ where t is an integer.
My question is: is the above correct or should $-30$ be changed to a positive number i.e. $8$

A simplification is to notice that $12x\equiv20\pmod{38}$ if and only if $6x\equiv10\pmod{19}$. Now,
\begin{align}
6\cdot3=18&\equiv-1\pmod{19}\\
6\cdot16\equiv6\cdot(-3)&\equiv1\qquad\text{so that}\\
6^{-1}&\equiv16\quad\text{and thus we get}\\
x\equiv6^{-1}\cdot6x\equiv16\cdot10=160&\equiv8\pmod{19}
\end{align}
