#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.setf(ios::fixed);
  cout.precision(8);
  int n;
  double v;
  cin >> n >> v;
  vector<double> a(n);
  vector<double> b(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  vector<double> p(n);
  for (int i = 0; i < n; i++) p[i] = b[i] / a[i];
  int iminim = 0;
  for (int i = 0; i < n; i++)
    if (p[i] < p[iminim]) iminim = i;
  double pminim = p[iminim];
  double s = 0;
  for (int i = 0; i < n; i++) s += pminim * a[i];
  if (s <= v)
    cout << s << endl;
  else {
    pminim *= v / s;
    s = 0;
    for (int i = 0; i < n; i++) s += pminim * a[i];
    cout << s << endl;
  }
}
