#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
pair<long long, long long> a[N];
long double ans;
long long n, T;
bool cmp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second < b.second;
}
signed main() {
  cin >> n >> T;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i].first;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> a[i].second;
    a[i].second -= T;
  }
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    ans += a[i].first;
    sum += a[i].first * a[i].second;
  }
  sort(a + 1, a + n + 1, cmp);
  if (sum > 0) {
    for (long long i = n; i >= 1; i--) {
      if (a[i].second == 0) continue;
      if (sum - a[i].first * a[i].second >= 0)
        sum -= a[i].first * a[i].second, ans -= a[i].first;
      else {
        ans -= (long double)sum / (long double)a[i].second;
        sum = 0;
        break;
      }
    }
  }
  if (sum < 0) {
    for (long long i = 1; i <= n; i++) {
      if (a[i].second == 0) continue;
      if (sum - a[i].first * a[i].second <= 0)
        sum -= a[i].first * a[i].second, ans -= a[i].first;
      else {
        ans -= (long double)sum / (long double)a[i].second;
        sum = 0;
        break;
      }
    }
  }
  if (ans == 0) return cout << 0, 0;
  cout << fixed << setprecision(9) << ans;
  return 0;
}
