Program stock;
Type
sc=array [1..1000] of real;
Var
s:sc;
i,j,n:longint;
m:longint;
max:real;
l,v:real;
z,b,w:longint;
Begin
assign(input,'stock.in');
assign(output,'stock.out');
reset(input);
rewrite(output);
readln(n);
l:=0;
v:=0;
for i:=1 to n do read(s[i]);
readln;
readln(m);
for i:=1 to n do
for j:=i+1 to n do
if s[j]-s[i]>max then max:=s[j]-s[i];
l:=max*m;
z:=0;
b:=0;
w:=0;
for i:=1 to n do begin
for j:=i+1 to n do begin
if s[j]>s[i] then z:=z+1;
if s[j]<s[i] then b:=b+1;
if s[j]=s[i] then w:=w+1;
end;
end;
if (z+b+w)<>0 then v:=z/(z+b+w);
writeln(l:0:3);
writeln(v:0:3);
close(input);
close(output);
End.