#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, v, minn = 0x7fffff;
  double a[21], b[21], sum = 0;
  cin >> n >> v;
  for (int i = 1; i <= n; i++) cin >> a[i], sum += a[i];
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    minn = min(b[i] / a[i], minn);
  }
  if (minn * sum >= v)
    printf("%0.6lf\n", v);
  else
    printf("%0.6lf\n", minn * sum);
  return 0;
}
