#include <bits/stdc++.h>
using namespace std;
double n, v, a[25], b[25], sum, maxx = 1e9;
int main() {
  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];
  for (int i = 1; i <= n; i++) maxx = min(maxx, b[i] / a[i]);
  printf("%.6lf\n", min(maxx * sum, v));
  return 0;
}
