#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
ostream &operator<<(ostream &out, const pair<T, T> &P) {
  out << P.first << ' ' << P.second;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &V) {
  for (int i = 0; i < V.size(); ++i) out << V[i] << ' ';
  return out;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &V) {
  for (T &i : V) in >> i;
  return in;
}
template <typename T>
istream &operator>>(istream &in, pair<T, T> &P) {
  in >> P.first >> P.second;
  return in;
}
bool cmp(pair<ll, ll> &p1, pair<ll, ll> &p2) { return p1.second < p2.second; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(12);
  ll n, T;
  cin >> n >> T;
  ll a[n], t[n];
  for (int i = int(0); i < int(n); i++) cin >> a[i];
  for (int i = int(0); i < int(n); i++) cin >> t[i];
  vector<ll> coefs(n);
  double ans = 0;
  ll neg = 0, pos = 0;
  for (int i = 0; i < n; ++i) {
    coefs[i] = t[i] - T;
    if (coefs[i] == 0)
      ans += a[i];
    else if (coefs[i] < 0)
      neg -= coefs[i] * a[i];
    else
      pos += coefs[i] * a[i];
  }
  if (neg < pos) {
    for (int i = int(0); i < int(n); i++)
      if (coefs[i] < 0) ans += a[i];
    vector<pair<ll, ll> > plus;
    for (int i = int(0); i < int(n); i++)
      if (coefs[i] > 0) plus.emplace_back(a[i], coefs[i]);
    sort(plus.begin(), plus.end(), cmp);
    double got = 0;
    for (int i = 0; i < (int)plus.size(); ++i) {
      if (plus[i].first * plus[i].second + got > neg) {
        ans += (double)(neg - got) / (double)plus[i].second;
        break;
      } else {
        ans += plus[i].first;
        got += plus[i].first * plus[i].second;
      }
    }
    cout << ans << '\n';
  } else {
    for (int i = int(0); i < int(n); i++)
      if (coefs[i] > 0) ans += a[i];
    vector<pair<ll, ll> > plus;
    for (int i = int(0); i < int(n); i++)
      if (coefs[i] < 0) plus.emplace_back(a[i], -coefs[i]);
    sort(plus.begin(), plus.end(), cmp);
    double got = 0;
    for (int i = 0; i < (int)plus.size(); ++i) {
      if (plus[i].first * plus[i].second + got > pos) {
        ans += (double)(pos - got) / (double)plus[i].second;
        break;
      } else {
        ans += plus[i].first;
        got += plus[i].first * plus[i].second;
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
