#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f3f3f;
template <typename INint>
inline void IN(INint &first) {
  first = 0;
  int f = 1;
  char c;
  cin.get(c);
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    cin.get(c);
  }
  while (c >= '0' && c <= '9') {
    first = first * 10 + c - '0';
    cin.get(c);
  }
  first *= f;
}
template <typename INint>
inline void OUT(INint first) {
  if (first > 9) OUT(first / 10);
  cout.put(first % 10 + '0');
}
const int maxn = int(2e5 + 5);
struct node {
  long long sp, t;
  bool operator<(node b) const { return t < b.t; }
} ns[maxn];
int n;
long long TT;
long long sum(0);
long long ans(0);
double fans;
int main() {
  int T(1), times(0);
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (++times, T--) {
    cin >> n >> TT;
    for (int i = 1; i <= int(n); i++) cin >> ns[i].sp, ans += ns[i].sp;
    for (int i = 1; i <= int(n); i++)
      cin >> ns[i].t, ns[i].t -= TT, sum += ns[i].t * ns[i].sp;
    sort(ns + 1, ns + 1 + n);
    if (sum < 0) {
      reverse(ns + 1, ns + 1 + n);
      for (int i = 1; i <= int(n); i++) ns[i].t = -ns[i].t;
      sum = -sum;
    }
    if (sum)
      for (int i = n; i >= int(1); --i) {
        if (ns[i].sp * ns[i].t < sum) {
          sum -= ns[i].sp * ns[i].t;
          ans -= ns[i].sp;
        } else {
          fans = (double)ans - double(sum) / ns[i].t;
          sum = 0;
          break;
        }
      }
    else
      fans = ans;
    cout << setprecision(8) << fixed << fans << endl;
  }
  return 0;
}
