program xmz;
var
f1,f2:text;
x,max:array[1..1000]of real;
h:array[1..1000]of longint;
n,nn,a,b,s:longint;
c:real;
begin
assign(f1,'stock.in');assign(f2,'stock.out');
reset(f1);rewrite(f2);
read(f1,n);
for a:=1 to n do
read(f1,x[a]);
for a:=1 to n-1 do
for b:=a+1 to n do
begin
if x[b]>x[a] then inc(h[a]);
if x[b]>max[a] then max[a]:=x[b];
end;
read(f1,nn);
for a:=1 to n do
begin
if trunc(nn/x[a])*(max[a]-x[a])>c then c:=trunc(nn/x[a])*(max[a]-x[a]);
if trunc(nn/x[a])>0 then inc(s,h[a]);
end;
writeln(f2,c:0:3);
writeln(f2,(s/(n*(n-1)/2)):0:3);
close(f1);close(f2);
end.