#include <bits/stdc++.h>
using namespace std;
struct no {
  int r;
  int l;
  int p;
};
int main() {
  int n;
  double v;
  double a[110];
  double b[110];
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (b[i] == 0) {
      cout << 0.0 << endl;
      return 0;
    }
  }
  double cu = a[0], ni = b[0];
  double aa = 0;
  for (int i = 1; i < n; i++) {
    if (b[i] / a[i] < ni / cu) {
      cu = a[i];
      ni = b[i];
    }
  }
  aa = ni / cu;
  double ans = 0;
  for (int i = 0; i < n; i++) ans += aa * a[i];
  if (ans > v) ans = v;
  cout << ans << endl;
  return 0;
}
