Elkhateb's blog

By Elkhateb, history, 2 years ago, In English

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

  • Vote: I like it
  • +2
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it +5 Vote: I do not like it

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.