#include <bits/stdc++.h>
const int N = 6e5 + 5, INF = 0x3f3f3f3f, mod = 1e9 + 7;
const double PI = acos(-1), EPS = 1e-9;
using namespace std;
namespace fast_IO {
long long read() {
  long long x = 0;
  char c;
  bool flag = false;
  while ((c = getchar()) == ' ' || c == '\n' || c == '\r')
    ;
  if (c == '-')
    flag = true;
  else
    x = c ^ 48;
  while ((c = getchar()) >= '0' && c <= '9') x = (x << 1) + (x << 3) + (c ^ 48);
  if (flag) return -x;
  return x;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 ^ 48);
}
}  // namespace fast_IO
int a[N], b[N];
double x = 1e10;
int main() {
  int n = fast_IO::read();
  double v = fast_IO::read();
  for (int i = 1; i <= n; ++i) a[i] = fast_IO::read();
  for (int i = 1; i <= n; ++i) b[i] = fast_IO::read();
  for (int i = 1; i <= n; ++i) x = min(x, 1.0 * b[i] / a[i]);
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans += a[i] * x;
  ans = min(ans, v);
  printf("%.5f", ans);
  return 0;
}
