#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long double t;
  cin >> n >> t;
  vector<pair<long double, long double>> a(n);
  long double p = 0, q = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].second;
  }
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first;
  }
  for (int i = 0; i < n; ++i) {
    p += a[i].first * a[i].second;
    q += a[i].second;
  }
  sort(a.begin(), a.end());
  if (p / q > t) {
    for (int i = n - 1; i >= 0; --i) {
      if (abs(p / q - t) < 1e-6) {
        break;
      }
      long double x = (p - t * q) / (a[i].first - t);
      if (x < -1e-6) {
        cout << 0;
        return 0;
      }
      x = min(x, a[i].second);
      p -= x * a[i].first;
      q -= x;
    }
  } else {
    for (int i = 0; i < n; ++i) {
      if (abs(p / q - t) < 1e-6) {
        break;
      }
      long double x = (p - t * q) / (a[i].first - t);
      if (x < -1e-6) {
        cout << 0;
        return 0;
      }
      x = min(x, a[i].second);
      p -= x * a[i].first;
      q -= x;
    }
  }
  if (abs(p / q - t) > 1e-6) {
    cout << 0;
    return 0;
  }
  cout.precision(25);
  cout << fixed << q;
  return 0;
}
