#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, V;
  cin >> N >> V;
  double tab[N];
  for (int i = 0; i < N; i++) {
    cin >> tab[i];
  }
  double mini = 500.0;
  for (int i = 0; i < N; i++) {
    double a;
    cin >> a;
    mini = min(mini, a / tab[i]);
  }
  double total = 0.0;
  for (int i = 0; i < N; i++) {
    total += tab[i] * mini;
  }
  cout << fixed << setprecision(10) << min((double)V, total) << endl;
}
