{
TASK: socks
LANG: PASCAL
}
program Socks;
const
  maxN = 30;
type
  Integer = LongInt;
var
  P: array [0..maxN] of Integer;
  Prices: array [0..MaxN] of Real;
  S: array [0..maxN] of integer;
  i, K, N, Rest: Integer;
  MinPrice: Real;

function EvalPrice: Real;
var
  i: Integer;
  Price: Real;
begin
  Price:= 0;
  for i:= 0 to N do
    Price:= Price + S[i] * Prices[i];
  EvalPrice:= Price;
end;

begin
  readln(N, K);
  P[0]:= 1;
  for i:= 1 to N do
    begin
      read(P[i]);
      P[i]:= P[i]*P[i-1];   { pri cheteneto direktno smqta tochnite broiki v P}
    end;
  readln;
  for i:= 0 to N do
    begin
      read(Prices[i]);
      S[i]:= 0;
    end;

  Rest:= K;     {izchislqva purvonachalna cena za tochna pokupka}
  i:= N;
  while Rest > 0 do
    begin
      S[i]:= Rest div P[i];
      Rest:= Rest mod P[i];
      dec(i);
    end;
  MinPrice:= EvalPrice;

  for i:= 0 to N-1 do
    begin
      if S[i] > 0 then
        begin
          S[i]:= 0;
          inc(S[i+1]);
        end;
      if EvalPrice < MinPrice then
        MinPrice:= EvalPrice;
    end;

  writeln(MinPrice:0:2);
end.

