#include <bits/stdc++.h>
using namespace std;
void solve() {
  double n, v, m = 200, k, ans = 0;
  cin >> n >> v;
  vector<double> a(n), b(n), c(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    ans += a[i];
  }
  for (long long int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (long long int i = 0; i < n; i++) {
    c[i] = (b[i] / a[i]);
    m = min(m, c[i]);
    if (m == c[i]) {
      k = i;
    }
  }
  cout << min(c[k] * ans, v);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
