Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def egcd(a, b):
- if a == 0:
- return (b, 0, 1)
- else:
- g, y, x = egcd(b % a, a)
- return (g, x - (b // a) * y, y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement