about summary refs log tree commit diff
path: root/others/volume1/082.pas
blob: f195aa7141a1f0aab0cd4b38a5240b4d2364c30f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
uses clib;

var
  n: int16;
  a, g, l: int32;

begin
  read(n, a);
  g := a;
  l := a;
  while n > 1 do
    begin
      dec(n);
      read(a);
      g := gcd(g, a);
      l := l * a div gcd(l, a);
      writeln(a, ' ', g, ' ', l)
    end;
  writeln(g, ' ', l)
end.