#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 87, inf = 0x3f3f3f3f;
pair<long long, long long> a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, T, s = 0, w = 0;
  cin >> n >> T;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].second;
    w += a[i].second;
  }
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
    a[i].first -= T;
    s += a[i].first * a[i].second;
  }
  if (s < 0) {
    s = -s;
    for (int i = 0; i < n; ++i) a[i].first *= -1;
  }
  sort(a, a + n);
  for (int i = n - 1; i >= 0 && a[i].first > 0 && s > 0; --i) {
    if (a[i].first * a[i].second <= s) {
      s -= a[i].first * a[i].second;
      w -= a[i].second;
    } else {
      double t = s * 1.0 / a[i].first;
      cout << setprecision(16) << w - t << '\n';
      return 0;
    }
  }
  cout << w << '\n';
}
