#include <bits/stdc++.h>
using namespace std;
int n, T;
int a[200000];
int t[200000];
int main(int argc, const char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin >> n >> T;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> t[i], t[i] -= T;
  vector<pair<int, int> > pos, neg;
  double res = 0;
  for (int i = 0; i < n; ++i) {
    if (t[i] == 0)
      res += a[i];
    else if (t[i] > 0)
      pos.push_back({t[i], a[i]});
    else
      neg.push_back({-t[i], a[i]});
  }
  sort(pos.begin(), pos.end());
  sort(neg.begin(), neg.end());
  double v1 = 0, v2 = 0;
  for (int i = 0; i < n; ++i) {
    if (t[i] > 0)
      v1 += t[i] * 1.0 * a[i];
    else
      v2 += t[i] * -1.0 * a[i];
  }
  double L = min(v1, v2);
  double R = min(v1, v2);
  double eps = 1e-6;
  for (int i = 0; i < neg.size(); ++i) {
    double vv = L / neg[i].first;
    res += min(vv, 1.0 * neg[i].second);
    L -= min(vv, 1.0 * neg[i].second) * neg[i].first;
    if (fabs(L) < eps) break;
  }
  L = R;
  for (int i = 0; i < pos.size(); ++i) {
    double vv = L / pos[i].first;
    res += min(vv, 1.0 * pos[i].second);
    L -= min(vv, 1.0 * pos[i].second) * pos[i].first;
    if (fabs(L) < 1e-6) break;
  }
  printf("%.20f\n", res);
}
