#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long MOD = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double PI = 3.141592653589793116, EPS = 1e-9,
                  GOLD = ((1 + sqrt(5)) / 2);
template <class T>
int getbit(T s, int i) {
  return (s >> 1) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
long long n, T;
vector<pair<long long, long long> > tap;
bool prioritizeTemp(pair<long long, long long> a,
                    pair<long long, long long> b) {
  return (abs(a.second) > abs(b.second));
}
void VarInput() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> T;
  tap.resize(n);
  for (long long i = 0; i < n; i++) cin >> tap[i].first;
  for (long long i = 0; i < n; i++) {
    cin >> tap[i].second;
    tap[i].second -= T;
  }
}
void ProSolve() {
  long long additional = 0;
  for (long long i = 0; i < n; i++) {
    if (tap[i].second == 0) additional += tap[i].first;
  }
  long double negative = 0, positive = 0, ans = 0;
  for (long long i = 0; i < n; i++) ans += tap[i].first;
  vector<pair<long long, long long> > neg, pos;
  for (long long i = 0; i < n; i++) {
    if (tap[i].second < 0) {
      negative += ((long double)tap[i].first * abs(tap[i].second));
      neg.push_back(tap[i]);
    } else if (tap[i].second > 0) {
      positive += ((long double)tap[i].first * abs(tap[i].second));
      pos.push_back(tap[i]);
    }
  }
  if (negative < EPS || positive < EPS) {
    cout << fixed << setprecision(9) << additional;
    return;
  }
  if (negative - positive >= EPS) {
    sort(neg.begin(), neg.end(), prioritizeTemp);
    for (long long i = 0; i < neg.size(); i++) {
      if (negative - positive < EPS) break;
      long double tmp = min((negative - positive) / abs(neg[i].second),
                            (long double)neg[i].first);
      ans -= tmp;
      negative -= (tmp * abs(neg[i].second));
    }
  } else if (positive - negative >= EPS) {
    sort(pos.begin(), pos.end(), prioritizeTemp);
    for (long long i = 0; i < pos.size(); i++) {
      if (positive - negative < EPS) break;
      long double tmp = min((positive - negative) / abs(pos[i].second),
                            (long double)pos[i].first);
      ans -= tmp;
      positive -= (tmp * abs(pos[i].second));
    }
  }
  cout << fixed << setprecision(9) << ans;
}
int main() {
  VarInput();
  ProSolve();
  return 0;
}
