#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long n, v;
double a[110], b[110];
int main() {
  cin >> n >> v;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  double x = b[1] / a[1];
  for (long long i = 2; i <= n; i++)
    if (b[i] / a[i] < x) x = b[i] / a[i];
  double tmp = 0;
  for (long long i = 1; i <= n; i++) tmp += x * a[i];
  if (tmp < v)
    printf("%.4lf", tmp);
  else
    cout << v;
}
