#include <bits/stdc++.h>
using namespace std;
int a[25], b[25];
int main(void) {
  int n, v;
  scanf("%d%d", &n, &v);
  for (int(i) = 0; (i) < (n); (i)++) {
    scanf("%d", &a[i]);
  }
  for (int(i) = 0; (i) < (n); (i)++) {
    scanf("%d", &b[i]);
  }
  int sum = 0;
  for (int(i) = 0; (i) < (n); (i)++) sum += a[i];
  double x = 1.0 * v / sum;
  for (int(i) = 0; (i) < (n); (i)++) {
    x = min(x, 1.0 * b[i] / a[i]);
  }
  printf("%.6lf\n", x * sum);
  return 0;
}
