#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, v;
  cin >> n >> v;
  vector<pair<int, int> > ingredients(n);
  cin >> ingredients[0].first;
  int total = ingredients[0].first;
  for (int i = 1; i < n; i++) {
    cin >> ingredients[i].first;
    total += ingredients[i].first;
  }
  for (int i = 0; i < n; i++) {
    cin >> ingredients[i].second;
  }
  auto minimum = ingredients[0];
  for (int i = 1; i < n; i++) {
    if (ingredients[i].second * minimum.first <
        ingredients[i].first * minimum.second) {
      minimum = ingredients[i];
    }
  }
  cout << fixed << setprecision(15);
  cout << min((double)total * ((double)minimum.second / (double)minimum.first),
              (double)v)
       << "\n";
  return 0;
}
