#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, v, a[21], b[21], sa, i;
  double k;
  scanf("%d %d", &n, &v);
  for (i = 0, sa = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sa += a[i];
  }
  for (i = 0; i < n; i++) scanf("%d", &b[i]);
  k = (double)v / (double)sa;
  for (i = 0; i < n; i++)
    if (k > (double)b[i] / (double)a[i]) k = (double)b[i] / (double)a[i];
  if (k * (double)sa - (int)(k * (double)sa) > 0)
    printf("%f\n", k * (double)sa);
  else
    printf("%.1f\n", k * (double)sa);
  return EXIT_SUCCESS;
}
