var A: array [1..100] of integer;
i,max,min,s: integer;
begin
randomize;
for i := 1 to 100 do begin
A[i] := random(100);
end;
max := 1;
for i := 2 to 100 do begin
if (A[i] > A[max]) then max := i;
min := 1;
if (A[i] < A[min]) then min := i;
s := A[max] - A[min];
writeln(s);
end.
var A: array [1..100] of integer;
i,max,min,s: integer;
begin
randomize;
for i := 1 to 100 do begin
A[i] := random(100);
end;
max := 1;
for i := 2 to 100 do begin
if (A[i] > A[max]) then max := i;
end;
min := 1;
for i := 2 to 100 do begin
if (A[i] < A[min]) then min := i;
end;
s := A[max] - A[min];
writeln(s);
end.