#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 1000 * 1000;
int n;
double L;
double ar[1000], br[1000];
int main() {
  cin >> n >> L;
  for (int i = 0; i < n; i++) cin >> ar[i];
  for (int i = 0; i < n; i++) cin >> br[i];
  double res = 0;
  double x = inf;
  for (int i = 0; i < n; i++) x = min(x, br[i] / ar[i]);
  for (int i = 0; i < n; i++) res += ar[i];
  res *= x;
  res = min(res, L);
  printf("%.5lf", res);
  return 0;
}
