#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a[N];
int b[N];
int main() {
  int n, V, i, sum;
  double x, ans;
  scanf("%d%d", &n, &V);
  for (i = 0, sum = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  x = (double)V / sum;
  for (i = 0; i < n; i++) {
    x = min(x, (double)b[i] / a[i]);
  }
  ans = x * sum;
  printf("%.8lf\n", ans);
  return 0;
}
