#include <bits/stdc++.h>
int N, V, ok;
double A[21], B[21], C[21];
double X, X1, X2, S;
int main() {
  scanf("%d%d", &N, &V);
  for (int i = 0; i < N; ++i) {
    scanf("%lf", &A[i]);
    X += A[i];
  }
  X2 = X1 = V / X;
  for (int i = 0; i < N; ++i) {
    scanf("%lf", &B[i]);
    X = B[i] / A[i];
    if (X < X2) X2 = X;
  }
  X = X1 < X2 ? X1 : X2;
  for (int i = 0; i < N; ++i) S += A[i] * X;
  printf("%.5lf ", S);
  return 0;
}
