#include <bits/stdc++.h>
using namespace std;
vector<int> Values;
int main() {
  double n, b;
  double promedio;
  double acum = 0.0;
  double final;
  double volumen;
  cin >> n >> volumen;
  final = volumen;
  for (int i = 0; i < n; i++) {
    cin >> b;
    Values.push_back(b);
    acum += b;
  }
  for (unsigned int i = 0; i < Values.size(); i++) {
    cin >> b;
    promedio = ((double)b / (double)Values[i]);
    final = min(promedio, final);
    if (i + 1 == Values.size()) final *= acum;
  }
  if (final > volumen)
    printf("%lf", volumen);
  else
    printf("%lf", final);
  cout << endl;
}
