about summary refs log tree commit diff
path: root/others/volume1/006.pas
blob: 2413c32672687e9fa24e718b9928da885482f775 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
uses clib;

var
  a, b, g: int64;
  c, d: longint;

begin
  readln(a, b, c, d);
  a := a * d + b * c;
  b := b * d;
  g := gcd(a, b);
  writeln(a div g, ' ', b div g)
end.