#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
const int Mod = 1e9 + 7;
const double eps = 1e-16;
inline int read() {
  int p = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    p = p * 10 + (ch - '0');
    ch = getchar();
  }
  return p * f;
}
char ss[N];
struct node {
  double a, t;
} q[N];
bool cmp(const node &x, const node &y) { return x.t < y.t; }
int main() {
  int n;
  double T;
  scanf("%d%lf", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%lf", &q[i].a);
  for (int i = 1; i <= n; i++) scanf("%lf", &q[i].t), q[i].t -= T;
  double s = 0;
  double ans = 0;
  double p = 0;
  for (int i = 1; i <= n; i++) s += q[i].a * q[i].t;
  sort(q + 1, q + n + 1, cmp);
  if (s > 0) {
    for (int i = 1; i <= n; i++) {
      if (ans + q[i].a * q[i].t <= 0)
        ans += q[i].a * q[i].t, p += q[i].a;
      else {
        p += (-ans) / q[i].t, ans = 0;
        break;
      }
    }
  } else {
    for (int i = n; i >= 1; i--) {
      if (ans + q[i].a * q[i].t >= 0)
        ans += q[i].a * q[i].t, p += q[i].a;
      else {
        p += (-ans) / q[i].t, ans = 0;
        break;
      }
    }
  }
  if (ans > eps)
    printf("0\n");
  else
    cout << fixed << setprecision(6) << p << endl;
  return 0;
}
