Extended Euclid's Algorithm
Problem
Natural numbers are given \(a, b, c.\) If the equation is \(a \cdot x + b \cdot y = c\) has integer solutions, then print \(gcd(a,b)\), \(x\) and \(y\) (any solution). If there is no solution, then print the word Impossible.
Input data
Natural numbers and do not exceed 10000 in absolute value.
Imprint
Print the answer to the problem.
Examples
| # |
Input |
Output |
| 1 |
1 2 3 |
1 1 1 |
| 2 |
10 6 8 |
2 2 -2 |
Запрещенные операторы: gcd