#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
int a[200], b[200], n, V;
long double c[200];
int main() {
  cout.flags(ios::fixed);
  cout.precision(8);
  cin >> n >> V;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    c[i] = (long double)b[i] / (long double)a[i];
  }
  long double m = 100000000.0, ans = 0;
  for (int i = 0; i < n; i++) {
    m = min(m, c[i]);
  }
  for (int i = 0; i < n; i++) {
    ans = ans + a[i] * m;
  }
  cout << min(ans, (long double)V * 1.0);
  return 0;
}
