#include <bits/stdc++.h>
using namespace std;
int n, m, q, v;
int dx[4] = {0, 0, -1, 1}, dy[4] = {1, -1, 0, 0};
double a[111111], b[111111];
int main() {
  while (~scanf("%d%d", &n, &v)) {
    int sm = 0;
    for (int i = 1; i <= n; ++i) scanf("%lf", &a[i]), sm += a[i];
    double avg = v * 1.0 / sm;
    for (int i = 1; i <= n; ++i) scanf("%lf", &b[i]), b[i] /= a[i];
    double mn = b[1];
    for (int i = 1; i <= n; ++i) mn = min(b[i], mn);
    mn = min(mn, avg);
    double ans = 0;
    for (int i = 1; i <= n; ++i) ans += a[i];
    printf("%.6lf\n", ans * mn);
  }
  return 0;
}
