#include <bits/stdc++.h>
using namespace std;
double b[100005];
double a[100005];
int main() {
  int n;
  double m;
  scanf("%d%lf", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &b[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
  }
  double ans = 0.0;
  double j = 0.0;
  while (1) {
    int f = 0;
    double sum = 0.0;
    for (int i = 0; i < n; i++) {
      if (b[i] * j <= a[i]) {
        sum += b[i] * j;
      } else {
        f = 1;
      }
    }
    if (f || sum > m) {
      printf("%f\n", ans);
      return 0;
    } else {
      ans = max(ans, sum);
    }
    j = j + 0.000001;
  }
  return 0;
}
