#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, T, x;
long double sum, ans;
struct node {
  long double a, b;
} p[N];
bool cmp(const node &A, const node &B) { return A.b > B.b; }
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%d", &x), p[i].a = x;
  for (int i = 1; i <= n; i++) scanf("%d", &x), p[i].b = x - T;
  for (int i = 1; i <= n; i++) ans += p[i].a * p[i].b, sum += p[i].a;
  if (ans == 0) return printf("%.10lf\n", (double)sum), 0;
  if (ans < 0) {
    for (int i = 1; i <= n; i++) p[i].b = -p[i].b;
    ans = -ans;
  }
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    if (p[i].b <= 0) break;
    if (ans > p[i].a * p[i].b)
      ans -= p[i].a * p[i].b, sum -= p[i].a;
    else
      return printf("%.10lf\n", (double)(sum - ans / p[i].b)), 0;
  }
  printf("%.10lf\n", (double)sum);
  return 0;
}
