#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[200005], b[200005];
int tot = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, T;
  cin >> n >> T;
  for (int i = 0; i < n; i++) cin >> a[i].second;
  for (int i = 0; i < n; i++) cin >> a[i].first;
  double sum1 = 0, sum2 = 0, res = 0;
  for (int i = 0; i < n; i++) {
    if (a[i].first < T)
      sum1 += 1.0 * (T - a[i].first) * a[i].second;
    else if (a[i].first > T)
      sum2 += 1.0 * (a[i].first - T) * a[i].second;
    else
      res += a[i].second;
  }
  for (int i = 0; i < n; i++) {
    if (sum1 <= sum2) {
      if (a[i].first < T)
        res += a[i].second;
      else if (a[i].first > T)
        b[tot] = a[i], b[tot++].first -= T;
    } else {
      if (a[i].first > T)
        res += a[i].second;
      else if (a[i].first < T)
        b[tot] = a[i], b[tot].first = T - b[tot].first, tot++;
    }
  }
  sort(b, b + tot);
  double temp = min(sum1, sum2);
  for (int i = 0; i < tot; i++) {
    double now = min(temp / b[i].first, 1.0 * b[i].second);
    res += now;
    temp -= now * b[i].first;
  }
  printf("%.7lf\n", res);
}
