#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, i;
  double ans = 0.0, mi = 10009.9;
  cin >> n >> v;
  double A[n], B[n], b[n];
  for (i = 0; i < n; i++) cin >> A[i];
  for (i = 0; i < n; i++) {
    cin >> B[i];
    b[i] = B[i] / A[i];
    mi = min(b[i], mi);
  }
  for (i = 0; i < n; i++) ans += A[i] * mi;
  if (ans > v) ans = v;
  cout << ans;
  return 0;
}
