记录编号 15218 评测结果 AAAAAAAAAA
题目名称 股票收益 最终得分 100
用户昵称 GravatarReimBurSe. 是否通过 通过
代码语言 Pascal 运行时间 0.150 s
提交时间 2009-11-10 17:02:47 内存使用 0.12 MiB
显示代码纯文本
Program stock;

Type
sc=array [1..1000] of real;

Var
s:sc;
i,j,n:longint;
m:longint;
max:real;
v:real;
z,b:longint;

Begin
assign(input,'stock.in');
assign(output,'stock.out');
reset(input);
rewrite(output);
readln(n);
v:=0;
for i:=1 to n do read(s[i]);
readln;
readln(m);
max:=0;
for i:=1 to (n-1) do
 for j:=i+1 to n do
  if (s[j]>s[i])and(s[i]<=m) then
   if trunc(m/s[i])*(s[j]-s[i])>max then
    max:=trunc(m/s[i])*(s[j]-s[i]);
z:=0;
b:=0;
for i:=1 to (n-1) do begin
 for j:=i+1 to n do begin
  if trunc(m/s[i])*(s[j]-s[i])>0 then z:=z+1
  else b:=b+1;
 end;
end;
if (z+b)<>0 then v:=z/(z+b);
writeln(max:0:3);
writeln(v:0:3);
close(input);
close(output);
End.