#include <bits/stdc++.h>
using namespace std;
int a[105], b[105];
double c[105];
int main() {
  int n, V;
  cin >> n >> V;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; ++i) c[i] = (double)b[i] / (double)a[i];
  sort(c, c + n);
  double res = 0.0;
  for (int i = 0; i < n; ++i) res += (double)a[i] * c[0];
  if (res < V)
    printf("%06lf\n", res);
  else
    printf("%06lf\n", (double)V);
  return 0;
}
