#include <stdio.h>
#include <algorithm>
using namespace std;
typedef struct Cake {
double ton;
double price;
double up;
} Cake;
bool cmp(Cake a, Cake b) {
return a.up > b.up;
}
int main(int argc, char *argv[]) {
int n;
double t;
scanf("%d %lf", &n, &t);
Cake *c = new Cake[n];
for (int i = 0; i < n; i++) {
scanf("%lf", &c[i].ton);
}
for (int i = 0; i < n; i++) {
scanf("%lf", &c[i].price);
c[i].up = c[i].price / c[i].ton;
}
sort(c, c + n, cmp);
int i = 0;
double p = 0.0;
while (t > 0 && i < n) {
if (c[i].ton > t) {
p += t * c[i].up;
break;
} else {
p += c[i].price;
t -= c[i].ton;
i++;
}
}
printf("%.2lf\n", p);
return 0;
}