#include <bits/stdc++.h>
using namespace std;
const int N = 202020;
int n, T;
struct NN {
  int a, t;
  bool operator<(const NN &c) const {
    if (t != c.t) return t < c.t;
    return a < c.a;
  }
} nn[N];
int main() {
  while (~scanf("%d%d", &n, &T)) {
    for (int i = (1); i < (n + 1); i++) scanf("%d", &nn[i].a);
    for (int i = (1); i < (n + 1); i++) scanf("%d", &nn[i].t);
    sort(nn + 1, nn + 1 + n);
    long long U = 0, V = 0;
    for (int i = (1); i < (n + 1); i++) {
      U += 1ll * nn[i].a * nn[i].t;
      V += (long long)nn[i].a;
    }
    if (U < V * T) {
      U = V = 0;
      int p = -1;
      for (int i = n; i; --i) {
        U += 1ll * nn[i].a * nn[i].t;
        V += (long long)nn[i].a;
        if (U < V * T) {
          p = i;
          break;
        }
      }
      U -= 1ll * nn[p].a * nn[p].t;
      V -= (long long)nn[p].a;
      printf("%.15lf\n", (double)(V + (long double)(T * V - U) /
                                          (long double)(nn[p].t - T)));
    } else if (U > V * T) {
      U = V = 0;
      int p = -1;
      for (int i = (1); i < (n + 1); i++) {
        U += 1ll * nn[i].a * nn[i].t;
        V += (long long)nn[i].a;
        if (U > V * T) {
          p = i;
          break;
        }
      }
      U -= 1ll * nn[p].a * nn[p].t;
      V -= (long long)nn[p].a;
      printf("%.15lf\n", (double)(V + (long double)(T * V - U) /
                                          (long double)(nn[p].t - T)));
    } else {
      printf("%lld.000000000000000\n", V);
    }
  }
  return 0;
}
