Extended Euclidean Algorithm
You have been given two Integers a and b. you need to find an integral solution of x and y such that a*x + b*y= gcd(a,b).Input Format
It can be proven that solution always exist.
The first line contains 2 integer a and bOutput Format
output integral value of x and y in a single line.Question Video
1 <= a, b <= 10^6Sample Input
34Sample Output
24
5 -7
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run