#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a, c;
  int n, v;
  cin >> n >> v;
  int s = 0;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    a.push_back(k);
    s += k;
  }
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    c.push_back(k);
  }
  double ans = 10000000;
  for (int i = 0; i < n; i++) {
    double k = double(c[i]) / a[i];
    if (k < ans) ans = k;
  }
  cout << setprecision(5) << min(s * ans, double(v));
}
