#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 14;
const long double eps = 1e-6;
int n, T, a[maxn], t[maxn], per[maxn];
bool check(long double s) {
  auto get = [](long double s) {
    long double ret = 0;
    for (int j = 0; j < n; j++) {
      int i = per[j];
      ret += min<long double>(s, a[i]) * t[i];
      s -= min<long double>(s, a[i]);
    }
    return ret;
  };
  long double lo = get(s), hi;
  reverse(per, per + n);
  hi = get(s);
  reverse(per, per + n);
  return lo <= s * T && s * T <= hi;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> T;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> t[i];
  iota(per, per + n, 0);
  sort(per, per + n, [](int i, int j) { return t[i] < t[j]; });
  long double lo = 0, hi = 2e11;
  while (hi - lo > eps) {
    long double mid = (lo + hi) / 2;
    (check(mid) ? lo : hi) = mid;
  }
  cout << fixed << setprecision(6) << (lo + hi) / 2 << '\n';
}
