#include <bits/stdc++.h>
const double Pi = acos(-1.0);
using namespace std;
const int maxN = 200000;
const double eps = 1e-12;
int n;
double T;
double a[maxN], t[maxN];
int main(int argc, char **argv) {
  scanf("%d %lf", &n, &T);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double ans = 0;
  vector<pair<double, double> > h, c;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &t[i]);
    if (t[i] == T)
      ans += a[i];
    else if (t[i] > T)
      h.push_back(pair<double, double>(t[i] - T, a[i]));
    else
      c.push_back(pair<double, double>(T - t[i], a[i]));
  }
  sort(h.begin(), h.end(), greater<pair<double, double> >());
  sort(c.begin(), c.end(), greater<pair<double, double> >());
  while (h.size() && c.size()) {
    pair<double, double> &ch = h.back(), &cc = c.back();
    double add = min(ch.first * ch.second, cc.first * cc.second);
    ch.second -= add / ch.first;
    cc.second -= add / cc.first;
    ans += add / ch.first + add / cc.first;
    if (ch.second < eps) h.pop_back();
    if (cc.second < eps) c.pop_back();
  }
  printf("%.12lf", ans);
  return 0;
}
