So, the general theory goes: if you want to solve \(ax + by = c\) over the integers, you first check that \(\gcd(a,b) | c\), because that's necessary for a solution. So you perform the extended
#EuclideanAlgorithm or
#Bézout's lemma as it's sometimes called, to compute \(x_0\) and \(y_0\) such that \(d := \gcd(a,b) = ax_0 + by_0\), Then you since the gcd divides \(c\), you just multiply \(ax_0 + by_0\) by \(c/d\) and you get a solution.