#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const double ERR = 1e-9, PI = (2 * acos(0.0));
template <class T>
inline int size(T& t) {
  return (int)t.size();
}
template <class T>
inline T MIN(T a, T b) {
  return ((a < b) ? a : b);
}
template <class T>
inline T MAX(T a, T b) {
  return ((b < a) ? a : b);
}
template <class T>
inline void checkMIN(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkMAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline T sqr(T x) {
  return (x * x);
}
double a[105], b[105], d[105];
int main() {
  int i, n;
  double V, x, r;
  while (cin >> n >> V) {
    for (i = 0; i < (int)(n); i++) cin >> a[i];
    for (i = 0; i < (int)(n); i++) {
      cin >> b[i];
      d[i] = (double)b[i] / a[i];
    }
    x = (double)INF;
    for (i = 0; i < (int)(n); i++) {
      checkMIN(x, d[i]);
    }
    r = 0.0;
    for (i = 0; i < (int)(n); i++) {
      r += x * a[i];
    }
    checkMIN(r, V);
    cout << r << endl;
  }
  return 0;
}
