Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. a = int(input())
  2. b = int(input())
  3. x1, y1, x2, y2 = 1, 0, 0, 1
  4. while b!=0:
  5. q = (a-(a%b))/b
  6. tempx, tempy = x2, y2
  7. x2 = x1-(q*tempx)
  8. y2 = y1-(q*tempy)
  9. x1, y1 = tempx, tempy
  10. a, b = b, a%b
  11. print(a, x1, y1)
  12. input("Press enter to continue..")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement