#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAXN = 100002;
const int MAXN2 = 777;
const int MOD = 1000000007;
const long long INF = 1e18 + 3;
int main() {
  int n, T;
  scanf("%d%d", &n, &T);
  vector<pair<long double, long double> > a(n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[i].second = x;
  }
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    a[i].first = x;
  }
  sort(a.begin(), a.end());
  long double sum = 0.0, all = 0.0;
  for (int i = 0; i < n; i++) {
    sum += a[i].second;
    all += a[i].second * a[i].first;
  }
  long double curt = all / sum;
  if (n == 1) {
    if (abs((long double)T - curt) < 0.000000001)
      cout << sum;
    else
      cout << 0;
    return 0;
  }
  if (curt > T) {
    for (int i = n - 1; i >= 1; i--) {
      if ((all - a[i].second * a[i].first) / (sum - a[i].second) > T) {
        all -= a[i].second * a[i].first;
        sum -= a[i].second;
      } else {
        long double l = 0.0, r = a[i].second;
        while (r - l > 0.00000001) {
          long double m = (l + r) / 2.0;
          if ((all - m * a[i].first) / (sum - m) > T)
            l = m;
          else
            r = m;
        }
        cout << fixed << setprecision(13) << sum - l;
        return 0;
      }
    }
  } else {
    for (int i = 0; i < n - 1; i++) {
      if ((all - a[i].second * a[i].first) / (sum - a[i].second) < T) {
        all -= a[i].second * a[i].first;
        sum -= a[i].second;
      } else {
        long double l = 0.0, r = a[i].second;
        while (r - l > 0.00000001) {
          long double m = (l + r) / 2.0;
          if ((all - m * a[i].first) / (sum - m) < T)
            l = m;
          else
            r = m;
        }
        cout << fixed << setprecision(13) << sum - l;
        return 0;
      }
    }
  }
  cout << 0;
}
