Extended Euclid Coefficients

Computer Mathematics Hard 3 views
Back to Questions

Problem Description

Find x,y such that ax+by=gcd(a,b). Print gcd x y.

Input Format

Two integers a b.

Output Format

g x y.

Sample Test Case

Input:
30 18
Output:
6 -1 2

Constraints

|a|,|b|

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next