#include <bits/stdc++.h>
const long long MOD = 1000000007;
using namespace std;
struct tap {
  long long a, t;
};
bool comp(tap lhs, tap rhs) {
  if (lhs.t < rhs.t)
    return true;
  else if (lhs.t > rhs.t)
    return false;
  else
    return (lhs.a < rhs.a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, T;
  long double tat = 0, ta = 0;
  cin >> n >> T;
  tap arr[n], arr1[n], arr2[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i].a;
    ta += arr[i].a;
  }
  for (int i = 0; i < n; ++i) {
    cin >> arr[i].t;
    tat += (arr[i].a * arr[i].t);
  }
  sort(arr, arr + n, comp);
  long double tmp = tat / ta;
  if (tmp > T) {
    int i = n - 1;
    while (i >= 1 && tmp > T) {
      tat -= (arr[i].a * arr[i].t);
      ta -= arr[i].a;
      tmp = tat / ta;
      i--;
    }
    if (tmp > T)
      cout << 0 << '\n';
    else if (tmp == T)
      cout << fixed << setprecision(20) << ta << '\n';
    else {
      i++;
      long double x = (tat - T * ta) / (T - arr[i].t);
      ta += x;
      cout << fixed << setprecision(20) << ta << '\n';
    }
  } else if (tmp < T) {
    int i = 0;
    while (i < n - 1 && tmp < T) {
      tat -= (arr[i].a * arr[i].t);
      ta -= arr[i].a;
      tmp = tat / ta;
      i++;
    }
    if (tmp < T)
      cout << 0 << '\n';
    else if (tmp == T)
      cout << fixed << setprecision(20) << ta << '\n';
    else {
      i--;
      long double x = (tat - T * ta) / (T - arr[i].t);
      ta += x;
      cout << fixed << setprecision(20) << ta << '\n';
    }
  } else if (tmp == T) {
    cout << fixed << setprecision(20) << ta << '\n';
  }
  return 0;
}
