#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, v, min = 100000, dem = 0;
  cin >> n >> v;
  vector<double> a, b;
  for (int i = 0; i < n; i++) {
    double x;
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    double x;
    cin >> x;
    b.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    double x = b[i] / a[i];
    if (x < min) min = x;
  }
  for (int i = 0; i < n; i++) {
    dem += min * a[i];
  }
  int x = dem;
  if (dem - x == 0) {
    if (dem < v)
      cout << dem << ".0";
    else
      cout << v << ".0";
    return 0;
  } else {
    if (dem < v)
      cout << dem;
    else
      cout << v;
    return 0;
  }
}
