#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, v, a[21], b[21], c[21], k = 100000, m = 0;
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m += a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    c[i] = b[i] / a[i];
    if (c[i] < k) {
      k = c[i];
    }
  }
  cout << min(k * m, v);
  return 0;
}
