Tổng Phân Số

PDF

Submit solution

Points: 10.00 (partial)
Time limit: 1.0s
Memory limit: 64M
Input: stdin
Output: stdout

Problem type
Allowed languages
C, C++, Java, Pascal, Python, Scratch, TEXT

Yêu cầu

Viết chương trình đọc vào ~4~ số nguyên dương ~a~, ~b~, ~c~, ~d~. Tìm phân số tối giản ~\displaystyle \frac{x}{y}=\frac{a}{b}+\frac{c}{d}~

Dữ liệu

Một dòng duy nhất gồm 4 số nguyên dương ~a~, ~b~, ~c~, ~d~ ~(a,b,c,d\le 10^9)~ cách nhau ít nhất 1 dấu cách.

Kết quả

Ghi ra hai số nguyên dương ~x~, ~y~ cách nhau ít nhất một dấu cách.

Input

1 2 3 4

Output

5 4

Comments

Please read the guidelines before commenting.


There are no comments at the moment.