#include <bits/stdc++.h>   using namespace std;   int main() {     iostream::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     ;     long long n, t;     cin >> n >> t;     vector<pair<long long, long long> > v(n);     double den = 0;     for (long long i = (0); i < (n); ++i) {       cin >> v[i].second;       den += v[i].second;     }     for (long long i = (0); i < (n); ++i) cin >> v[i].first;     sort(v.begin(), v.end());     double sm = 0;     for (long long i = (0); i < (n); ++i) {       sm += v[i].first * v[i].second;     }     if (sm / den == (double)t) {       cout << setprecision(8) << den;       exit(0);     }     if ((double)sm / den > t) {       for (long long i = n - 1; i >= 0; i--) {         if ((double)(sm - v[i].first * v[i].second) / (den - v[i].second) > t) {           sm -= v[i].first * v[i].second;           den -= v[i].second;           continue;         } else {           cout << setprecision(8)                << den + (double)(sm - t * den) / (t - v[i].first);           exit(0);         }       }     } else {       for (long long i = 0; i < n; i++) {         if ((double)(sm - v[i].first * v[i].second) / (den - v[i].second) < t) {           sm -= v[i].first * v[i].second;           den -= v[i].second;           continue;         } else {           cout << setprecision(8)                << den + (double)(sm - t * den) / (t - v[i].first);           exit(0);         }       }     }     cout <<  0 ;   }   