#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double eps = 1e-10;
const int MAXN = 200009;
int n;
double T;
struct Lu {
  double x, y;
  bool operator<(const Lu &p) const { return y < p.y; }
} L[MAXN];
int cmp(double xx) {
  if (fabs(xx) < eps)
    return 0;
  else
    return xx < 0 ? -1 : 1;
}
int main() {
  scanf("%d %lf", &n, &T);
  for (int i = 1; i <= n; ++i) scanf("%lf", &L[i].x);
  for (int i = 1; i <= n; ++i) scanf("%lf", &L[i].y);
  sort(L + 1, L + 1 + n);
  double ans = 0;
  if (L[1].y > T || L[n].y < T) {
    printf("%.6f\n", ans);
    return 0;
  }
  int kk = 0, k = n + 1, flag = 0;
  for (int i = 1; i <= n; ++i) {
    if (L[i].y == T)
      ans += L[i].x;
    else if (L[i].y < T) {
      kk = i;
    } else if (L[i].y > T) {
      k = i;
      break;
    }
  }
  while (kk >= 1 && k <= n) {
    if (cmp(L[kk].x) == 0) --kk;
    if (kk < 1) break;
    if (cmp(L[k].x) == 0) ++k;
    if (k > n) break;
    double tmp1 = L[k].y - T;
    double tmp2 = T - L[kk].y;
    if (cmp(L[k].x - L[kk].x * tmp2 / tmp1) == -1) {
      ans += L[k].x;
      double tmp = L[k].x * tmp1 / tmp2;
      ans += tmp;
      L[kk].x -= tmp;
      L[k].x = 0;
    } else {
      ans += L[kk].x;
      double tmp = L[kk].x * tmp2 / tmp1;
      ans += tmp;
      L[k].x -= tmp;
      L[kk].x = 0;
    }
  }
  printf("%.6f\n", ans);
  return 0;
}
