#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
template <class A, class B>
void CONV(A &x, B &y) {
  stringstream s;
  s << x;
  s >> y;
}
int CMP(double a, double b) { return a < b - 1e-8 ? -1 : a > b + 1e-8 ? 1 : 0; }
int n, bound, p[20], v[20];
bool check(double x) {
  double sum = x;
  for (int i = (1); i < (n); ++i) {
    double y = (x * p[i]) / p[0];
    if (y > v[i]) return false;
    sum += y;
  }
  return sum <= bound;
}
double calc(double x) {
  double res = x;
  for (int i = (1); i < (n); ++i) res += (x * p[i]) / p[0];
  return res;
}
int main() {
  while (cin >> n >> bound) {
    for (int i = (0); i < (n); ++i) cin >> p[i];
    for (int i = (0); i < (n); ++i) cin >> v[i];
    double low = 0, high = v[0];
    while (high - low > 1e-5) {
      double mid = (low + high) / 2;
      if (check(mid))
        low = mid;
      else
        high = mid;
    }
    cout << calc(low) << endl;
  }
}
