#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, V;
  cin >> n >> V;
  vector<int> a(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> b(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  vector<double> c(n, 0.0);
  for (int i = 0; i < n; ++i) {
    c[i] = (double)b[i] / (double)a[i];
  }
  vector<double>::iterator min_pro = min_element(c.begin(), c.end());
  double res = 0.0;
  for (int i = 0; i < n; ++i) {
    res += (double)a[i] * (*min_pro);
  }
  if (res < V) {
    printf("%04lf\n", res);
  } else {
    printf("%04lf\n", (double)V);
  }
  return 0;
}
