# Solution of Linear Diophantine Equation

How to find all solutions of Linear Diophantine Equation $$a \cdot x + b \cdot y = c$$ given $$a,b,c$$ where $$c$$ is divisible by $$\gcd(a,b)$$ and constraints are $$x_0 \leq x \leq x_1$$ and $$y_0 \leq y \leq y_1$$ ?

• Solution set of $(x,y,c)$ is every $x,y$ within the constraint, since every linear combination of $a,b$ is divisible by their GCD. – L KM Mar 29 at 10:03
• @LKM. Given a = 1, b = c = 2, and 0 <= x,y <= 1000, how many integers x,y have x + 2y = 2??? – William Elliot Mar 30 at 2:22
• Then of course there is 2 solutions, namely, $(x,y)=(0,1), (2,0)$. So the question should be formulated as follows? \\ How to find all solutions (x,y) of Linear Diophantine Equation $a \cdot x + b \cdot y = c$ with $a,b,c$ fixed and c divisible by $\gcd(a,b)$ ? – L KM Mar 30 at 4:10
• Edited the question. – Parth Patel Mar 30 at 13:45