#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MXN = 2e5 + 5;
ll a[MXN];
ll t[MXN];
int ind[MXN];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cout << setprecision(12) << fixed;
  int n, T;
  cin >> n >> T;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  ll sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; ++i) {
    cin >> t[i];
    sum1 += a[i];
    sum2 += a[i] * t[i];
  }
  iota(ind, ind + n, 0);
  sort(ind, ind + n, [&](int x, int y) { return t[x] < t[y]; });
  if (sum2 > sum1 * T) {
    for (int i = n - 1; i >= 0; --i) {
      ll aa = a[ind[i]];
      ll tt = t[ind[i]];
      if (sum2 - aa * tt <= (sum1 - aa) * T) {
        cout << sum1 - 1.L * (sum2 - sum1 * T) / (tt - T);
        return 0;
      }
      sum1 -= aa;
      sum2 -= aa * tt;
    }
  } else if (sum2 < sum1 * T) {
    for (int i = 0; i < n; ++i) {
      ll aa = a[ind[i]];
      ll tt = t[ind[i]];
      if (sum2 - aa * tt >= (sum1 - aa) * T) {
        cout << sum1 - 1.L * (sum2 - sum1 * T) / (tt - T);
        return 0;
      }
      sum1 -= aa;
      sum2 -= aa * tt;
    }
  }
  cout << sum1 << '\n';
}
