#include <bits/stdc++.h>
using namespace std;
const long long int N = 200005;
const long double e = 1e-10;
long long int n, T;
pair<long long int, long long int> a[N];
signed main() {
  scanf("%lld %lld", &n, &T);
  for (long long int i = 1; i <= n; i++) scanf("%lld", &a[i].second);
  for (long long int i = 1; i <= n; i++) scanf("%lld", &a[i].first);
  sort(a + 1, a + n + 1);
  if (a[n].first < T) return !printf("0");
  long double nu = 0, d = 0;
  long long int i;
  for (i = 1; i <= n; i++) {
    if (a[i].first <= T)
      nu += a[i].first * a[i].second, d += a[i].second;
    else
      break;
  }
  for (; i <= n; i++) {
    long double p = nu + a[i].first * a[i].second;
    p /= (d + a[i].second);
    if (p < T) {
      nu += a[i].first * a[i].second;
      d += a[i].second;
    } else {
      long double l = 0, r = a[i].second;
      while (r - l > e) {
        long double m = (l + r) / 2;
        long double p = (nu + a[i].first * m);
        p /= (d + m);
        if (p <= T)
          l = m;
        else
          r = m;
      }
      d += l;
      printf("%0.10Lf", d);
      return 0;
    }
  }
  nu = 0, d = 0;
  for (i = n; i >= 1; i--) {
    if (a[i].first >= T)
      nu += a[i].first * a[i].second, d += a[i].second;
    else
      break;
  }
  for (; i >= 1; i--) {
    long double p = nu + a[i].first * a[i].second;
    p /= (d + a[i].second);
    if (p > T) {
      nu += a[i].first * a[i].second;
      d += a[i].second;
    } else {
      long double l = 0, r = a[i].second;
      while (r - l > e) {
        long double m = (l + r) / 2;
        long double p = (nu + a[i].first * m);
        p /= (d + m);
        if (p >= T)
          l = m;
        else
          r = m;
      }
      d += l;
      printf("%0.10Lf ", d);
      return 0;
    }
  }
  printf("%0.10Lf ", d);
  return 0;
}
