#include <bits/stdc++.h>
using namespace std;
const int MAXN = 20 + 5;
int main() {
  int n;
  double v;
  double a[MAXN], b[MAXN];
  cin >> n >> v;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  double sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  double out = v;
  for (int i = 0; i < n; i++) out = min(out, b[i] / a[i] * sum);
  cout << out << endl;
  return 0;
}
