#include <bits/stdc++.h>
using namespace std;
int a[200010], tt[200010];
vector<pair<double, double> > small, big;
int main() {
  int n;
  double t;
  cin >> n >> t;
  double neg = 0, pos = 0;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tt[i]);
  }
  for (int i = 1; i <= n; i++) {
    double x = a[i], y = tt[i];
    if (y < t) {
      neg += (t - y) * x;
      small.push_back({t - y, x});
    } else if (y > t) {
      pos += (y - t) * x;
      big.push_back({(y - t), x});
    } else {
      ans += x;
    }
  }
  if (pos >= neg) {
    for (auto x : small) ans += x.second;
    sort(big.begin(), big.end());
    double now = 0;
    for (int i = 0; i < big.size(); i++) {
      if (now + big[i].first * big[i].second <= neg) {
        now += big[i].first * big[i].second;
        ans += big[i].second;
      } else {
        ans += (neg - now) / big[i].first;
        break;
      }
    }
  } else if (pos <= neg) {
    for (auto x : big) ans += x.second;
    sort(small.begin(), small.end());
    double now = 0;
    for (int i = 0; i < small.size(); i++) {
      if (now + small[i].first * small[i].second <= pos) {
        now += small[i].first * small[i].second;
        ans += small[i].second;
      } else {
        ans += (pos - now) / small[i].first;
        break;
      }
    }
  }
  printf("%.10f\n", ans);
}
