GO Solution For UVa 10104 - Euclid Problem. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

From Euclid it is known that for any positive integers A and B there exist such integers X and Y that AX +BY = D, where D is the greatest common divisor of A and B. The problem is to find for given A and B corresponding X, Y and D.

Input The input will consist of a set of lines with the integer num

...

You can find the full details of the problem Euclid Problem at UVa Online Judge

Sample Input

4 6
17 17

Sample Output

-1 1 2
0 1 17

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985