How to code this?//

how will i going to find k value??

If you have a solution of equation of ax+by = gcd(a,b) , then you can manipulate the equation to get the value of z and y for the equation ax+by = c. Let the x be x1 and y be y1 from the equation (ax+by = gcd(a,b) ) , then for the equation ax + by = c , the value of x and y will be a(x1c/g) + b(y1c/g) = gg/g -> [ax1c/g + by1*c/g = c] , only if c is multiple of gcd(a,b).
You can read every thing here.
Explained briefly -:
https://cp-algorithms.com/algebra/linear-diophantine-equation.html

that document was really helpful but couldnt able to understand how to find the family of solution and solution in a paticular range( CODE)

That is just shifting of points. Try some examples on notebook and you will get it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.