#include <bits/stdc++.h>
using namespace std;
const int NMAX = 30;
const double EPS = 1e-8;
double ans = 0;
int n;
double v;
int a[NMAX], b[NMAX];
int main() {
  cin >> n >> v;
  for (int i = 0; i < int(n); ++i) cin >> a[i];
  for (int i = 0; i < int(n); ++i) cin >> b[i];
  double l = 0, r = v;
  while (l + EPS < r) {
    double mid = (l + r) / 2;
    bool ok = true;
    double sum = 0;
    for (int i = 0; i < int(n); ++i) {
      if (a[i] * mid > b[i] + EPS) ok = false;
      sum += a[i] * mid;
      if (sum > v + EPS) ok = false;
    }
    if (ok) {
      ans = max(ans, sum);
      l = mid;
    } else
      r = mid;
  }
  printf("%.5lf", ans);
  return 0;
}
