#include <bits/stdc++.h>
using namespace std;
vector<pair<double, double> > t1, t2;
int dat1[200005], dat2[200005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, t, i, j;
  double res = 0;
  cin >> n >> t;
  for (i = 0; i < n; i++) {
    cin >> dat1[i];
  }
  for (i = 0; i < n; i++) {
    cin >> dat2[i];
  }
  for (i = 0; i < n; i++) {
    if (dat2[i] == t) {
      res += dat1[i];
    } else if (dat2[i] < t) {
      t1.push_back({dat2[i], dat1[i]});
    } else {
      t2.push_back({dat2[i], dat1[i]});
    }
  }
  sort(t1.begin(), t1.end());
  sort(t2.begin(), t2.end());
  reverse(t1.begin(), t1.end());
  int i1 = 0, i2 = 0;
  pair<double, double> a, b;
  double da, db;
  double pa, pb;
  while (i1 < t1.size() && i2 < t2.size()) {
    a = t1[i1];
    b = t2[i2];
    da = t - a.first;
    db = b.first - t;
    if (da * a.second > db * b.second) {
      i2++;
      pa = (db * b.second) / (da * a.second);
      pa = a.second * pa;
      pb = b.second;
      res += pa + pb;
      t1[i1].second -= pa;
    } else {
      i1++;
      pb = (da * a.second) / (db * b.second);
      pb = b.second * pb;
      pa = a.second;
      res += pa + pb;
      t2[i2].second -= pb;
    }
  }
  cout.precision(7);
  cout << fixed << res;
  return 0;
}
