#include <iostream>
#include <algorithm>
using namespace std;
struct node
{
double amounts, prices, perprice;
}mooncakes[1010];
int cmp(node n1, node n2)
{
return n1.perprice > n2.perprice;
}
int main()
{
int n;
double d;
scanf("%d%lf", &n, &d);
int i;
for(i = 1; i <= n; i++)
{
scanf("%lf", &mooncakes[i].amounts);
}
for(i = 1; i <= n; i++)
{
scanf("%lf", &mooncakes[i].prices);
mooncakes[i].perprice = mooncakes[i].prices / mooncakes[i].amounts;
}
sort(mooncakes + 1, mooncakes + n + 1, cmp);
node nod;
double res = 0;
for(i = 1; i <= n; i++)
{
nod = mooncakes[i];
if(nod.amounts >= d)
{
res += d * nod.perprice;
break;
}
else
{
res += nod.prices;
d -= nod.amounts;
}
}
printf("%.2lf\n", res);
system("pause");
return 0;
}