#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double V, p, sum = 0;
  cin >> n >> V;
  vector<double> a, b;
  for (int i = (0); i < (n); ++i) {
    cin >> p;
    sum += p;
    a.push_back(p);
  }
  for (int i = (0); i < (n); ++i) {
    cin >> p;
    b.push_back(sum * p / a[i]);
  }
  b.push_back(V);
  sort(b.begin(), b.end());
  printf("%.5lf", b[0]);
  return 0;
}
