#include <bits/stdc++.h>
using namespace std;
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
void solve() {
  int n, v;
  cin >> n >> v;
  vector<double> a(n), b(n);
  double sum_a = 0, mn = DBL_MAX;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    double temp = b[i] / a[i];
    mn = min(mn, temp);
    sum_a += a[i];
  }
  cout << fixed << setprecision(10);
  cout << min(double(v), sum_a * mn) << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tc = 1;
  while (tc--) solve();
}
