#include <bits/stdc++.h>
using namespace std;
int a[25];
double b[25];
double c[25];
int main() {
  int n;
  double v;
  while (scanf("%d%lf", &n, &v) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    double min = 999999.9;
    for (int i = 0; i < n; i++) {
      scanf("%lf", &b[i]);
      c[i] = 1.0 * b[i] / a[i];
      if (c[i] < min) {
        min = c[i];
      }
    }
    double tot = 0;
    for (int i = 0; i < n; i++) {
      b[i] = min * a[i];
      tot += b[i];
    }
    if (tot > v) {
      printf("%lf\n", v);
    } else {
      printf("%lf\n", tot);
    }
  }
  return 0;
}
