#include <bits/stdc++.h>
using namespace std;
int mas[21];
double num[21];
int main() {
  int n, v, sum = 0;
  cin >> n >> v;
  for (int i = 0; i < n; ++i) {
    cin >> mas[i];
    sum += mas[i];
  }
  double Min = -1;
  int k;
  for (int i = 0; i < n; ++i) {
    cin >> k;
    num[i] = double(k) / double(mas[i]);
    if (Min == -1 || num[i] < Min) Min = num[i];
  }
  double c;
  c = v / double(sum);
  Min = min(c, Min);
  printf("%.4f", sum * Min);
  return 0;
}
