Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = int(input())
- b = int(input())
- x1, y1, x2, y2 = 1, 0, 0, 1
- while b!=0:
- q = (a-(a%b))/b
- tempx, tempy = x2, y2
- x2 = x1-(q*tempx)
- y2 = y1-(q*tempy)
- x1, y1 = tempx, tempy
- a, b = b, a%b
- print(a, x1, y1)
- input("Press enter to continue..")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement