#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  int n;
  double v;
  cin >> n >> v;
  double arr[30];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  double per[30];
  double mini = 100000.0;
  for (int i = 0; i < n; i++) {
    cin >> per[i];
    mini = min(mini, per[i] / arr[i]);
  }
  double sum = 0.0;
  for (int i = 0; i < n; i++) {
    sum += (arr[i] * mini);
  }
  if (sum > v)
    cout << v << endl;
  else
    cout << sum << endl;
  return 0;
}
