Extended Euclid Coefficients
Computer Mathematics
Hard
3 views
Problem Description
Find x,y such that ax+by=gcd(a,b). Print gcd x y.
Input Format
Two integers a b.
Official Solution
Use recursive extended Euclid: if b==0 return (a,1,0). Else compute for (b,a%b) then back-substitute.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!