#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, T;
pair<long long, long long> v[N];
void solve() {
  cin >> n >> T;
  for (long long i = 0; i < n; i++) cin >> v[i].second;
  for (long long i = 0; i < n; i++) cin >> v[i].first;
  long long num = 0, sum = 0;
  for (long long i = 0; i < n; i++) {
    num += v[i].first * v[i].second;
    sum += v[i].second;
  }
  sort(v, v + n);
  if (num < T * sum) {
    T *= -1;
    for (long long i = 0; i < n; i++) {
      v[i].first *= -1;
    }
    reverse(v, v + n);
    num *= -1;
  }
  long long pos = n - 1;
  while (pos >= 0 && num > T * sum) {
    num -= v[pos].first * v[pos].second;
    sum -= v[pos].second;
    --pos;
  }
  ++pos;
  long double lo = 0.00, hi = v[pos].second;
  for (long long i = 1; i < 101; i++) {
    long double mid = (lo + hi) / 2.0;
    long double nn = num + mid * v[pos].first;
    long double dd = sum + mid;
    if (nn < T * dd) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  long double x = sum + lo;
  cout << setprecision(10) << fixed << x << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::ios::sync_with_stdio(false);
  long long te = 1;
  while (te--) {
    solve();
  }
}
