 Both terms in "ax" + "by" are divisible by "g"; therefore, "c" must also be divisible by "g", or the equation has no solutions.By dividing both sides by "c"/"g", the equation can be reduced to Bezout's identity

where "s" and "t" can be found by the extended Euclidean algorithm.This provides one solution to the Diophantine equation, "x"1 = "s" ("c"/"g") and "y"1 = "t" ("c"/"g").