Submit solution
Points:
0.26 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Tìm hai số nguyên không âm ~x_1~ và ~x_2~ thỏa mãn ~a_1 \times x_1 + b_1 = a_2 \times x_2 + b_2~ và ~x_1 + x_2~ là nhỏ nhất. Biết rằng luôn tồn tại số ~x_1, x_2~ thỏa mãn.
Input
Gồm 1 dòng 4 số nguyên ~a_1, b_1, a_2, b_2~ (các số nguyên không âm trong phạm vi ~[0, 2^{31} - 1]~).
Output
Ghi ra 2 số ~x_1, x_2~ thỏa mãn yêu cầu đề bài.
Sample Input
3 4 5 5
Sample Output
2 1
Comments