Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

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.

Input

  • A single line containing four integers a1, b1, a2, b2 (the integers are within the interval [0..231-1].

Output

  • Print two integers x1, x2.

Example

Input
3 4 5 5

Output
2 1

Được gửi lên bởi:Nguyen Minh Hieu
Ngày:2008-07-05
Thời gian chạy:1s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM guile SCM qobi ST TEXT WHITESPACE
Nguồn bài:VNOI Marathon '08 - Round 4
Problem Setter: Nguyễn Minh Hiếu

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.