#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, m;
  double v, s, b, a, arr[20], brr[20], crr[20], l, t;
  cin >> n >> v;
  s = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    s += arr[i];
  }
  for (i = 0; i < n; i++) cin >> brr[i];
  t = INT_MAX;
  for (i = 0; i < n; i++) {
    crr[i] = (brr[i]) / (arr[i] / (s));
    t = min(t, crr[i]);
  }
  if (v < t)
    printf("%.4lf", v);
  else
    printf("%.4lf", t);
  return 0;
}
