#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 77, Mod = 1e9 + 7;
priority_queue<pair<long double, long double> > more;
priority_queue<pair<long double, long double> > lesser;
long double n, a[N], t[N], T;
long double A;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> T;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> t[i];
  for (int i = 1; i <= n; i++) {
    if (t[i] == T) {
      A += a[i];
      continue;
    }
    if (t[i] < T) {
      lesser.push(make_pair(t[i], a[i]));
    } else {
      more.push(make_pair(-t[i], a[i]));
    }
  }
  while (more.size() && lesser.size()) {
    auto R = more.top(), L = lesser.top();
    more.pop();
    lesser.pop();
    long double ratio =
        (long double)(-R.first - T) / (long double)(T - L.first);
    ratio = 1 / ratio;
    if (L.second * ratio <= R.second) {
      A += (L.second) * (ratio + 1);
      R.second -= L.second * ratio;
      more.push(R);
      continue;
    } else {
      ratio = 1 / ratio;
      A += (R.second) * (ratio + 1);
      L.second -= R.second * ratio;
      lesser.push(L);
      continue;
    }
  }
  cout << fixed << setprecision(10) << A;
  return 0;
}
