#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long double T;
  cin >> n >> T;
  vector<pair<long double, long double> > tap(n);
  long double sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> tap[i].second;
    sum += tap[i].second;
  }
  for (int i = 0; i < n; ++i) {
    cin >> tap[i].first;
  }
  sort(tap.begin(), tap.end());
  long double left = 0, right = sum;
  while ((right - left) / max(left, (long double)1.0) > 1e-8) {
    long double mid = (right + left) / 2;
    long double want = T * mid;
    long double bigT = 0, smallT = 0, bigSum = mid, smallSum = mid;
    for (int i = 0; i < n; ++i) {
      if (bigSum < tap[i].second) {
        bigT = bigT + bigSum * tap[i].first;
        bigSum = 0;
      } else {
        bigT = bigT + tap[i].first * tap[i].second;
        bigSum = bigSum - tap[i].second;
      }
    }
    for (int i = n - 1; i >= 0; --i) {
      if (smallSum < tap[i].second) {
        smallT += smallSum * tap[i].first;
        smallSum = 0;
      } else {
        smallSum -= tap[i].second;
        smallT += tap[i].first * tap[i].second;
      }
    }
    if (bigT <= want && smallT >= want)
      left = mid;
    else
      right = mid;
  }
  cout << fixed << setprecision(9) << (left + right) / 2 << endl;
  return 0;
}
