#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double V, x, A = 0;
  double a[200], b[200];
  cin >> n >> V;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    A += a[i];
  }
  x = V / A;
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    if (a[i] * x > b[i]) x = b[i] / a[i];
  }
  printf("%0.5f\n", x * A);
}
