#include <bits/stdc++.h>
using namespace std;
int main() {
  long double n, v, ans = 2e9, temp, volume = 0, a[201], b[201];
  int i, j, k;
  cin >> n >> v;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n; i++) {
    temp = b[i] / a[i];
    ans = min(temp, ans);
  }
  for (i = 0; i < n; i++) {
    volume += ans * a[i];
  }
  cout << setprecision(6) << min(v, volume) << endl;
}
