#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ifstream from;
  const long long nmin = 1, nmax = 20, vmin = 1, vmax = 10000, abmin = 1,
                  abmax = 100;
  long long n, m, res, rt, i, i0, j, k, ax, v;
  long double dt;
  if (0) from.open("test.txt");
  cin >> n >> v;
  vector<long long> ai(n), bi(n);
  for (i = 0; i < n; i++) cin >> ai[i];
  for (i = 0; i < n; i++) cin >> bi[i];
  i0 = 0;
  rt = ai[0];
  for (i = 1; i < n; i++) {
    i0 = (bi[i] * ai[i0] < bi[i0] * ai[i]) ? i : i0;
    rt += ai[i];
  }
  dt = (v * ai[i0] < rt * bi[i0]) ? (1.0 * v) : (1.0 * rt * bi[i0]) / ai[i0];
  cout.precision(5);
  cout << fixed << dt << endl;
  return 0;
}
