ax+by=c where a,b,c are given integer numbers. I know that for linear equations, there is exist a solution if and only if c is a multiple of d =gcd(a,b). This is called Bezout's lemma. In the following problem, I write a solution to check the answer, but it gives me a wrong answer in test 23 which is 14x+19y = 143. any help why did this happen? link to the problem
This lemma is true when x, y are arbitrary integers but according to the question x>=0 and y>=0 must hold as you can not have negative moves.