#include <bits/stdc++.h>
using namespace std;
double a[200000], t[200000];
bool cmp(int b, int c) { return t[b] < t[c]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  double T;
  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;
  }
  int id[200000];
  for (int i = 0; i < n; i++) id[i] = i;
  double sum = 0;
  for (int i = 0; i < n; i++) sum += a[i] * t[i];
  if (sum < 0)
    for (int i = 0; i < n; i++) t[i] = -t[i];
  sort(id, id + n, cmp);
  double ans = 0;
  sum = 0;
  for (int i = 0; i < n; i++)
    if (ans + a[id[i]] * t[id[i]] <= 0)
      ans += a[id[i]] * t[id[i]], sum += a[id[i]];
    else {
      sum += ans / -t[id[i]];
      break;
    }
  printf("%.12lf", fabs(sum));
  return 0;
}
