Extended Euclid Algorithm (1 Viewer)

mamun11

New Member
Joined
Sep 10, 2014
Messages
9
Gender
Male
HSC
N/A
A Linear Diophantine Equation is of the following form: Ax+By+C=0, where x1≤x≤x2 and y1≤y≤y2.

If the value of A,B,C,x1,x2,y1,y2 are given and x1≤x2 and y1≤y2, then how many solutions can be found? How can I find out the total number of solutions according to the above condition.

I asked the above question in this link:http://math.stackexchange.com/questions/959029/solving-a-linear-diophantine-equation before.

But there I didn't give sample input and output. I liked the second answer in the above link but when I checked the sample input and output according to the second answer it gives me wrong result

It is worthy of mention that the reasoning of the second answer based on A,B>0 but my question is that what I have to do if A,B<0 and how will I match sample input and output using the given answer.

Here,I have included sample input and output
Capture.JPG
I need a method that will fulfill the above input and output and a example that will show how to find out the number of solutions by matching the the above input and output.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top