#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, v;
  double min, sum, a[25], b[25], p1[25], p2[25];
  memset(a, 0, sizeof a);
  cin >> n >> v;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) cin >> b[i];
  min = b[0] / a[0];
  for (i = 0; i < n; i++) {
    p1[i] = a[i];
    p2[i] = b[i] / a[i];
    if (min > p2[i]) min = p2[i];
  }
  sum = 0.0;
  for (i = 0; i < n; i++) sum += p1[i];
  sum *= min;
  if (sum > v) sum = v;
  cout << sum;
  return 0;
}
