#include <bits/stdc++.h>
const int N = 2e5 + 5;
int n, T;
struct Node {
  double a, t;
  bool operator<(const Node &b) const { return t > b.t; }
} a[N], b[N];
bool check(double x) {
  double sum = 0, sum2 = 0, t = x;
  for (int i = 1; i <= n; i++) {
    if (t > a[i].a)
      sum += a[i].a * a[i].t, t -= a[i].a;
    else {
      sum += t * a[i].t;
      break;
    }
  }
  t = x;
  for (int i = 1; i <= n; i++) {
    if (t > b[i].a)
      sum2 += b[i].a * b[i].t, t -= b[i].a;
    else {
      sum2 += t * b[i].t;
      break;
    }
  }
  return sum2 <= x * T && sum >= x * T;
}
int main() {
  scanf("%d%d", &n, &T);
  double sum = 0;
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i].a), sum += a[i].a;
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i].t);
  std::sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) b[i] = a[n + 1 - i];
  double l = 0, r = sum, mid;
  for (int i = 0; i < 70; i++) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  printf("%.8f\n", l);
  return 0;
}
