#include <bits/stdc++.h>
using namespace std;
namespace FGF {
int n, m;
const int N = 2e5 + 5;
const double eps = 1e-10;
struct Node {
  double x, t;
} a[N];
double sum, ans;
bool cmp(Node u, Node v) { return u.t < v.t; }
void work() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i].x);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i].t), a[i].t -= m;
    sum += a[i].x * a[i].t;
  }
  sort(a + 1, a + n + 1, cmp);
  if (a[1].t > 0 || a[n].t < 0) {
    puts("0");
    return;
  }
  if (sum > 0) {
    sum = 0;
    for (int i = 1; i <= n; i++) {
      if (sum + a[i].x * a[i].t > 0) {
        ans = ans + sum / (-a[i].t);
        break;
      } else
        ans += a[i].x, sum += a[i].x * a[i].t;
    }
  } else {
    sum = 0;
    for (int i = n; i; i--) {
      if (sum + a[i].x * a[i].t < 0) {
        ans = ans + sum / (-a[i].t);
        break;
      } else
        ans += a[i].x, sum += a[i].x * a[i].t;
    }
  }
  printf("%.12f", ans);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
