#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 500;
const long long mod = 1e9 + 7;
const long long cmod = 998244353;
const long long inf = 1LL << 61;
const int M = 1e6 + 500;
const long long int ths = 1LL << 40;
const int NN = 5e3 + 6;
void solve() {
  long long int n, T;
  cin >> n >> T;
  long long int a[n], t[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> t[i];
  cout << fixed << setprecision(10);
  long long int l = 0, h = 0;
  for (int i = 0; i < n; i++) {
    if (t[i] < T) {
      l += (T - t[i]) * a[i];
    } else {
      h += (t[i] - T) * a[i];
    }
  }
  if (l < h) {
    vector<pair<long long int, long long int> > v;
    long double ans = 0;
    for (int i = 0; i < n; i++) {
      if (t[i] > T) {
        v.push_back({t[i] - T, a[i]});
      } else {
        ans += a[i];
      }
    }
    sort(v.begin(), v.end());
    long long int cur = 0;
    for (auto it : v) {
      if (cur + it.first * it.second <= l) {
        cur += it.first * it.second;
        ans += it.second;
      } else {
        ans += (long double)(l - cur) / it.first;
        cur = l;
      }
    }
    cout << ans;
  } else {
    vector<pair<long long int, long long int> > v;
    long double ans = 0;
    for (int i = 0; i < n; i++) {
      if (t[i] < T) {
        v.push_back({T - t[i], a[i]});
      } else {
        ans += a[i];
      }
    }
    sort(v.begin(), v.end());
    long long int cur = 0;
    for (auto it : v) {
      if (cur + it.first * it.second <= h) {
        cur += it.first * it.second;
        ans += it.second;
      } else {
        ans += (long double)(h - cur) / it.first;
        cur = h;
      }
    }
    cout << ans;
  }
  cout << '\n';
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
