#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, v, ans = 0, mn = 99999999, r = 0;
  double a[25], b[25];
  cin >> n >> v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    r += a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    b[i] /= a[i];
    mn = min(mn, b[i]);
  }
  for (int i = 0; i < n; i++) {
    b[i] = mn * a[i];
    ans += b[i];
  }
  cout << min(ans, v) << endl;
  return 0;
}
