#include<iostream>
#include<algorithm>
using namespace std;
typedef struct node
{
double w;
double v;
}Node;
Node b[20005];
bool cmp(Node a,Node b)
{
return (a.v/a.w) > (b.v/b.w);
}
int main()
{
int n;
double c;
while(cin>>n>>c)
{
int i;
for(i = 0;i < n;i++)
cin>>b[i].w;
for(i = 0;i < n;i++)
cin>>b[i].v;
sort(b,b+n,cmp);
double sum = 0.0;
for(i = 0;i < n;i++)
{
if(b[i].w <= c)
{
sum += b[i].v;
c = c-b[i].w;
}
else
{
break;
}
}
if(i <= n)
{
sum = sum + c * b[i].v/b[i].w;
}
printf("%.1lf\n",sum);
}
return 0;
}