Var a,b,c,d,e,m1,m2,m3,ITOG:integer;
Procedure nod(x,y:integer;var n:integer);
Begin
If x=y then n:=x
else
if x>y then NOD(x-y, y, n)
Else NOD(x, y-x, n);
end;
begin
read (a,b,c,d,e);
nod(a,b,m1);
nod(c,d,m2);
nod(m1,m2,m3);
nod(m3,e,ITOG);
writeln (ITOG);
end.
Пример:
90 135 45 315 75
15