#include <bits/stdc++.h>
using namespace std;
float min(float a, float b) { return a < b ? a : b; }
int main() {
  int n, v;
  cin >> n >> v;
  vector<int> a, b;
  int c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    a.push_back(c);
  }
  for (int i = 0; i < n; i++) {
    cin >> c;
    b.push_back(c);
  }
  float m = v + 10, v1 = 0;
  for (int i = 0; i < n; i++) {
    m = min(m, b[i] / (float)a[i]);
  }
  for (int i = 0; i < n; i++) {
    v1 += a[i] * m;
  }
  if (v1 > v) v1 = v;
  cout << v1;
  return 0;
}
