#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  float v;
  cin >> n;
  cin >> v;
  float arr[n], test[n];
  float sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> test[i];
  }
  float y = v / sum;
  float x = INT_MAX;
  for (int i = 0; i < n; i++) {
    float a = test[i] / arr[i];
    x = min(x, a);
  }
  float ans;
  ans = min(x, y);
  ans = ans * sum;
  cout << setprecision(5) << ans;
}
