#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
long double T;
pair<long double, long double> A[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> T;
  long double sum = 0.0, ans = 0.0;
  for (int x = 0, qwerty = n; x < qwerty; x++) {
    cin >> A[x].second;
    ans += A[x].second;
  }
  for (int x = 0, qwerty = n; x < qwerty; x++) {
    cin >> A[x].first;
  }
  for (int x = 0, qwerty = n; x < qwerty; x++) sum += A[x].second * A[x].first;
  sort(A, A + n);
  if (A[0].first > T || A[n - 1].first < T) {
    cout << "0\n";
    return 0;
  }
  if (sum > T * ans) {
    for (int x = n - 1; x >= 1; x--) {
      long double tmp = (sum - A[x].second * A[x].first) / (ans - A[x].second);
      if (tmp > 1e-12 + T) {
        sum -= A[x].second * A[x].first;
        ans -= A[x].second;
      } else {
        ans -= A[x].second;
        sum -= A[x].second * A[x].first;
        double l = 0, h = A[x].second;
        for (int i = 0, qwerty = 120; i < qwerty; i++) {
          double mid = (h + l) / 2;
          if (sum + mid * A[x].first > T * (ans + mid)) {
            h = mid;
          } else {
            l = mid;
          }
        }
        ans += (l + h) / 2.;
        sum += (l + h) / 2. * A[x].first;
        break;
      }
    }
  } else if (sum < T * ans) {
    for (int x = 0, qwerty = n - 1; x < qwerty; x++) {
      long double tmp = (sum - A[x].second * A[x].first) / (ans - A[x].second);
      if (tmp + 1e-12 < T) {
        sum -= A[x].second * A[x].first;
        ans -= A[x].second;
      } else {
        ans -= A[x].second;
        sum -= A[x].second * A[x].first;
        double l = 0, h = A[x].second;
        for (int i = 0, qwerty = 120; i < qwerty; i++) {
          double mid = (h + l) / 2;
          if (sum + mid * A[x].first < T * (ans + mid)) {
            h = mid;
          } else {
            l = mid;
          }
        }
        ans += (l + h) / 2.;
        sum += (l + h) / 2. * A[x].first;
        break;
      }
    }
  }
  cout << fixed << setprecision(15) << ans << "\n";
}
