#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << showpoint << setprecision(15);
  long long n, t, temp, sum = 0, asum = 0;
  cin >> n >> t;
  pair<long long, long long> a[n + 1];
  for (long long i = (1); i <= (n); i++) cin >> a[i].second;
  for (long long i = (1); i <= (n); i++) {
    cin >> temp;
    a[i].first = temp - t;
    sum += a[i].first * a[i].second;
    asum += a[i].second;
  }
  sort(a + 1, a + n + 1);
  if (sum == 0)
    cout << asum;
  else if (sum >= 0) {
    long long status = 0;
    for (long long i = (n); i >= (1); i--) {
      sum -= a[i].first * a[i].second;
      asum -= a[i].second;
      if (sum <= 0) {
        status = a[i].first;
        break;
      }
    }
    if (status)
      cout << asum - (double)(sum) / status;
    else
      cout << 0;
  } else {
    long long status = 0;
    for (long long i = (1); i <= (n); i++) {
      sum -= a[i].first * a[i].second;
      asum -= a[i].second;
      if (sum >= 0) {
        status = a[i].first;
        break;
      }
    }
    if (status)
      cout << asum - (double)(sum) / status;
    else
      cout << 0;
  }
}
