Блог пользователя Elkhateb

Автор Elkhateb, история, 22 месяца назад, По-английски

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

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
22 месяца назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

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.