#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, i, j;
  float min = -1, p[50], t[50];
  cin >> n >> v;
  for (i = 0; i < n; i++) {
    scanf("%f", &p[i]);
  }
  for (i = 0; i < n; i++) {
    scanf("%f", &t[i]);
    float cal = t[i] / p[i];
    if (min == -1)
      min = cal;
    else if (cal < min)
      min = cal;
  }
  float ans = 0;
  for (i = 0; i < n; i++) {
    ans = ans + (p[i] * min);
  }
  if (ans > v) ans = v;
  printf("%f\n", ans);
}
