#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double PI = acos(-1);
const long long INFF = 1e18;
const int INF = 1e9 + 1;
const int mod = 1e9 + 7;
const int MAX = 2e5 + 7;
pair<long double, long double> a[MAX];
vector<pair<long double, long double>> ll, rr;
int n, t;
void init() {
  scanf("%d %d", &n, &t);
  for (int i = (1); i < (n + 1); ++i) scanf("%Lf", &a[i].second);
  for (int i = (1); i < (n + 1); ++i) scanf("%Lf", &a[i].first);
  return;
}
void sol() {
  long double ans = 0;
  for (int i = (1); i < (n + 1); ++i) {
    if (a[i].first > t)
      rr.push_back(a[i]);
    else if (a[i].first < t)
      ll.push_back(a[i]);
    else
      ans += a[i].second;
  }
  sort((ll).begin(), (ll).end(), greater<pair<long long, long long>>());
  sort((rr).begin(), (rr).end());
  int l = 0, r = 0;
  while (l < ((int)ll.size()) && r < ((int)rr.size())) {
    long double d1 = t - ll[l].first, v1 = ll[l].second;
    long double d2 = rr[r].first - t, v2 = rr[r].second;
    if (v1 * d1 > v2 * d2) {
      ans += v2 + v2 * d2 / d1;
      ll[l].second -= v2 * d2 / d1;
      r++;
    } else if (v1 * d1 < v2 * d2) {
      ans += v1 + v1 * d1 / d2;
      rr[r].second -= v1 * d1 / d2;
      l++;
    } else {
      ans += v1 + v2;
      l++;
      r++;
    }
  }
  printf("%.13Lf\n", ans);
  return;
}
int main(void) {
  init();
  sol();
  return 0;
}
