#include <bits/stdc++.h>
using namespace std;
const int maxn = 200002;
const double inf = 1e16;
pair<int, int> a[maxn];
vector<int> p;
int n, T, lim[maxn];
int64_t MAX[maxn];
double solve(vector<int> p, int64_t s) {
  int64_t tmpMax = 0;
  for (int i = 0; i < p.size(); ++i) {
    tmpMax += max(0LL, 1LL * p[i] * lim[i]);
  }
  if (tmpMax < s) return -inf;
  double t = 0, res = 0;
  MAX[p.size()] = 0;
  for (int i = p.size() - 1; i >= 0; --i)
    MAX[i] = MAX[i + 1] + max(0LL, 1LL * p[i] * lim[i]);
  for (int i = 0; i < p.size(); ++i) {
    if (p[i] > 0) {
      double tmp = min(double(lim[i]), double(s - t) / p[i]);
      res += tmp;
      t += tmp * p[i];
    } else if (p[i] < 0) {
      double tmp = min(double(lim[i]), double(s - t - MAX[i + 1]) / p[i]);
      if (tmp < 0) return -inf;
      res += tmp;
      t += tmp * p[i];
    } else
      res += lim[i];
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> T;
  for (int i = 0; i < n; ++i) cin >> a[i].second;
  for (int i = 0; i < n; ++i) cin >> a[i].first;
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    p.push_back(a[i].first - T);
    lim[i] = a[i].second;
  }
  double res = solve(p, 0);
  reverse(a, a + n);
  p.clear();
  int64_t s = 0, tmp = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i].first - T <= 0) {
      lim[p.size()] = a[i].second;
      p.push_back(T - a[i].first);
    } else {
      s += 1LL * (a[i].first - T) * a[i].second;
      tmp += a[i].second;
    }
  }
  cout << setiosflags(ios::fixed) << setprecision(8)
       << max(res, solve(p, s) + tmp);
}
