#include <bits/stdc++.h>
const bool DEBUG = false;
using namespace std;
const long long maxn = 2e5 + 5;
const long long INF = 1e18 + 1;
const long long M = 1e9 + 7;
const int lg = 21;
int n;
long double sum, sd, T, ans, now, zero, t[maxn], x[maxn], a[maxn], b[maxn];
vector<int> mo, ma, se, v;
long double doo(vector<int> v, long double sum) {
  long double ans = 0;
  pair<long double, long double> p[maxn];
  int n = v.size();
  fill(a, a + n, (long double)0);
  fill(b, b + n, (long double)0);
  for (int i = 0; i < n; i++)
    a[i] = x[v[i]], b[i] = abs(t[v[i]] - T), p[i] = {b[i], a[i]};
  sort(p, p + n);
  for (int i = n - 1; i >= 0; i--) {
    long double x = p[i].second, z = p[i].first;
    if (sum - x * z <= 0) return -(ans + sum / z);
    ans += x;
    sum -= x * z;
  }
  return -INF;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> T;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) {
    cin >> t[i];
    if (t[i] - T < 0) ma.push_back(i), sum += (t[i] - T) * x[i], ans += x[i];
    if (t[i] - T == 0) ans += x[i];
    if (t[i] - T > 0) mo.push_back(i), sum += (t[i] - T) * x[i], ans += x[i];
  }
  if (sum > 0) ans += doo(mo, sum);
  if (sum < 0) ans += doo(ma, -sum);
  if (ans <= -(long double)2e16)
    return cout << fixed << setprecision(12) << zero << endl, 0;
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}
