INTEGER7 - Integers
Find two nonnegative integers x1 and x2 so that a1 * x1 + b1 = a2 * x2 + b2 and x1 + x2 is minimized. Given that there exist x1 and x2 satisfying the above equation.
- A single line containing four integers a1, b1, a2, b2 (the integers are within the interval [0..231-1].
- Print two integers x1, x2.
Input 3 4 5 5 Output 2 1