#include <bits/stdc++.h>
int n, a[100], b[100], i, v;
double x, y, z, k, j, r;
bool ok() {
  k = 0;
  for (i = 0; i < n; ++i) {
    j = a[i] * z;
    if (j <= b[i]) {
      k += j;
      if (k > v) return 0;
    } else
      return 0;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &v);
  for (i = 0; i < n; ++i) scanf("%d", a + i);
  for (i = 0; i < n; ++i) scanf("%d", b + i);
  x = 0.001;
  y = v + 1;
  while (y - x > 0.00000000001) {
    z = (x + y) / 2;
    if (ok()) {
      x = z;
      r = k;
    } else
      y = z;
  }
  printf("%lf\n", r);
  return 0;
}
