#include <bits/stdc++.h>
using namespace std;
int main() {
  double a[105], b[105], n, m, v, c[105], sum = 0, mini = 200;
  int i, j;
  cin >> n >> v;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (i = 1; i <= n; i++) {
    c[i] = b[i] / a[i];
    if (c[i] < mini) {
      mini = c[i];
    }
  }
  for (i = 1; i <= n; i++) {
    sum = sum + a[i] * mini;
  }
  if (sum > v) {
    cout.precision(4);
    cout << fixed;
    cout << v;
  } else {
    cout.precision(4);
    cout << fixed;
    cout << sum;
  }
}
