{
TASK:SOCKS
LANG:PASCAL
}
var
i,j,n,k:longint;
cena:real;
p:array[1..32] of record
                  socks:longint;
                  cena:real;
                  end;

function sum(a,b:longint):longint;
var a1,b1,s:longint;
begin
a1:=a;
b1:=b;
s:=a1 div b1;
a1:=a1-b1*s;
if a1>0 then s:=s+1;
sum:=s;
end;

function count(index:longint):real;
begin
count:=sum(k,p[index].socks)*p[index].cena;
end;

begin
readln(n,k);
p[1].socks:=1;
for i:=1 to n do begin read(j); p[i+1].socks:=p[i].socks*j;end;
for i:=1 to n+1 do read(p[i].cena);
n:=n+1;
i:=n;
repeat
if k>p[i].socks then begin k:=k-p[i].socks;cena:=p[i].cena+cena;end
                else begin
                     if count(i)<count(i-1) then begin k:=k-p[i].socks;cena:=p[i].cena+cena;end
                                            else dec(i);
                     end;
until k<=0;
writeln(cena:0:2);
end.
