#include <bits/stdc++.h>
using namespace std;
int n, T, A[200010], tt;
double r = 0.0, rr = 0.0, ans = 0.0;
struct taps {
  int a, t;
  double at;
  bool operator<(const taps &b) const {
    if (t != b.t) return t < b.t;
    return a < b.a;
  }
} p[200010], q[200010];
int pcnt = 0, qcnt = 0;
double calc(double x) {
  double ret = 0.0, xx = x, cur;
  for (int i = 1; i <= pcnt; ++i) {
    cur = p[i].at;
    if (x > cur)
      x -= cur, ret += p[i].a;
    else {
      ret += x / p[i].t;
      break;
    }
  }
  x = xx;
  for (int i = qcnt; i >= 1; --i) {
    cur = q[i].at;
    if (x + cur > 0)
      x += cur, ret += q[i].a;
    else {
      ret += -(x / q[i].t);
      break;
    }
  }
  return ret;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; ++i) scanf("%d", &A[i]);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &tt);
    if (tt > T) {
      ++pcnt;
      p[pcnt].a = A[i];
      p[pcnt].t = tt - T;
      p[pcnt].at = (double)p[pcnt].a * p[pcnt].t;
      r += p[pcnt].at;
    } else if (tt < T) {
      ++qcnt;
      q[qcnt].a = A[i];
      q[qcnt].t = tt - T;
      q[qcnt].at = (double)q[qcnt].a * q[qcnt].t;
      rr += -q[qcnt].at;
    } else
      ans += (double)A[i];
  }
  sort(p + 1, p + pcnt + 1);
  sort(q + 1, q + qcnt + 1);
  printf("%.15lf\n", ans + calc(min(r, rr)));
  return 0;
}
