#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int n, T;
pair<int, int> a[N];
int main() {
  scanf("%d%d", &n, &T);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i].second);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i].first), a[i].first -= T;
  sort(a, a + n);
  long long sum = 0;
  for (int i = (0); i < (n); ++i) sum += 1ll * a[i].first * a[i].second;
  double ans = 0;
  for (int i = (0); i < (n); ++i) ans += a[i].second;
  if (sum > 0) {
    for (int i = (n)-1; i >= (0); --i) {
      long long tmp = 1ll * a[i].first * a[i].second;
      if (sum - tmp > 0) {
        sum -= tmp;
        ans -= a[i].second;
        continue;
      }
      ans -= (double)sum / a[i].first;
      sum = 0;
      break;
    }
  } else if (sum < 0) {
    for (int i = (0); i < (n); ++i) {
      long long tmp = 1ll * a[i].first * a[i].second;
      if (sum - tmp < 0) {
        sum -= tmp;
        ans -= a[i].second;
        continue;
      }
      ans -= (double)sum / a[i].first;
      sum = 0;
      break;
    }
  }
  printf("%.15f\n", ans);
  return 0;
}
