a guest Jun 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def egcd(a, b):
  2.     if a == 0:
  3.         return (b, 0, 1)
  4.     else:
  5.         g, y, x = egcd(b % a, a)
  6.         return (g, x - (b // a) * y, y)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand