#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int maxn = 2e5 + 5;
double T, a[maxn], t[maxn];
vector<pair<double, double> > T1, T2;
int main() {
  int n;
  scanf("%d%lf", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &t[i]);
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    if (t[i] == T)
      sum += a[i];
    else if (t[i] < T)
      T1.emplace_back(make_pair(T - t[i], a[i]));
    else
      T2.emplace_back(make_pair(t[i] - T, a[i]));
  }
  sort(T1.begin(), T1.end());
  sort(T2.begin(), T2.end());
  int pos1 = 0, pos2 = 0;
  while (pos1 < T1.size() && pos2 < T2.size()) {
    double ans =
        min(T1[pos1].first * T1[pos1].second, T2[pos2].first * T2[pos2].second);
    sum += ans / T1[pos1].first + ans / T2[pos2].first;
    T1[pos1].second -= ans / T1[pos1].first,
        T2[pos2].second -= ans / T2[pos2].first;
    if (T1[pos1].second <= eps) pos1++;
    if (T2[pos2].second <= eps) pos2++;
  }
  printf("%.10f\n", sum);
}
