#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
char grid[2002][2002];
double max_(double a, double b) {
  if (a > b) return a;
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ifstream in("duom.txt");
  int n;
  double v;
  cin >> n >> v;
  int a[22];
  double parts = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    parts += a[i];
  }
  int b[22];
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  double x1 = v / parts;
  double misprop[100];
  double biggest = -inf;
  for (int i = 0; i < n; ++i) {
    misprop[i] = max_(1, x1 * a[i] / b[i]);
    if (misprop[i] > biggest) biggest = misprop[i];
  }
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += a[i] * x1 / biggest;
  }
  cout << fixed << setprecision(12) << ans;
  in.close();
  return 0;
}
