#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  while (cin >> n >> v) {
    vector<int> need(n);
    double ratio = 1e6;
    int have, sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> need[i];
      sum += need[i];
    }
    for (int i = 0; i < n; i++) {
      cin >> have;
      ratio = min(ratio, have / (double)need[i]);
    }
    ratio = min(ratio, v / (double)sum);
    printf("%.9lf\n", ratio * sum);
  }
  return 0;
}
