#include <bits/stdc++.h>
using namespace std;
int n;
double v, a[20], b[20];
int main() {
  scanf("%d %lf", &n, &v);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  for (int i = 0; i < n; i++) scanf("%lf", &b[i]);
  double ans = 0.0;
  for (int i = 0; i < n; i++) {
    double soup = b[i];
    bool can = 1;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      soup = soup + (b[i] * a[j]) / a[i];
      if ((b[i] * a[j]) / a[i] > b[j]) can = 0;
    }
    if (can) ans = max(ans, soup);
  }
  ans = min(ans, v);
  printf("%.9lf\n", ans);
  return 0;
}
