Extended Euclid Algorithm
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Write a program that finds such x and y that a · x + b · y = 1.
Input
Two positive integers a and b (1 ≤ a, b ≤ 10000).
Output
If x and y exist, print in the first line YES and in the second line print x and y, otherwise print in one line NO.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 782
Acceptance rate 51%