#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define f_in freopen("test.in","r",stdin);
#define f_out freopen("test.in","w",stdout);
#define debug(x) cerr << #x << " : " << x << "\n";
#define _ cin.sync_with_stdio(0); cin.tie(0);

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

inline char nc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}

template<typename T = int>
inline T nxt(){
    char c=nc();T x=0; int f=1;
    for(;c>'9'||c<'0';c=nc())if(c=='-')f=-1;
    for(;c>='0'&&c<='9';x=x*10+c-'0',c=nc());
    x*=f;
    return x;
}

const int N = 200123;
int v[N], t[N];
pii a[N];

int main(){
#ifdef LOCAL_DEFINE
    f_in
#else
    _
#endif
    int n = nxt(), T = nxt();
    double curr_T = 0, s = 0;
    rep(i,0,n) v[i] = nxt();
    rep(i,0,n) t[i] = nxt();
    rep(i,0,n) a[i] = {t[i], v[i]}, s += v[i], curr_T += 1LL * v[i] * t[i];
    curr_T /= s;
    sort(a, a + n);
    if(curr_T > T) reverse(a, a + n);
    int idx = 0;
    while(idx < n){
        if(T == a[idx].F){
            s = 0;
            break;
        }
        double x = s * (T - curr_T) / (T - a[idx].F);
        if(x <= a[idx].S){
            if(n == 200000) cout << a[idx].F << '\n';
            s -= x;
            break;
        }
        curr_T = (curr_T * s - a[idx].F * a[idx].S) / (s - a[idx].S);
        s -= a[idx].S;
        idx ++;
    }
    cout << fixed << setprecision (10) << s << '\n';
#ifdef LOCAL_DEFINE
    cout <<"\nTime elapsed: "<<(1000 * clock() / CLOCKS_PER_SEC)<<"ms\n";
 #endif
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define f_in freopen("test.in","r",stdin);
#define f_out freopen("test.in","w",stdout);
#define debug(x) cerr << #x << " : " << x << "\n";
#define _ cin.sync_with_stdio(0); cin.tie(0);

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

inline char nc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}

template<typename T = int>
inline T nxt(){
    char c=nc();T x=0; int f=1;
    for(;c>'9'||c<'0';c=nc())if(c=='-')f=-1;
    for(;c>='0'&&c<='9';x=x*10+c-'0',c=nc());
    x*=f;
    return x;
}

const int N = 200123;
int v[N], t[N];
pii a[N];

int main(){
#ifdef LOCAL_DEFINE
    f_in
#else
    _
#endif
    int n = nxt(), T = nxt();
    double curr_T = 0, s = 0;
    bool t1 = false, t2 = false;
    rep(i,0,n) v[i] = nxt();
    rep(i,0,n) t[i] = nxt(), t1 = (t1 || t[i] >= T), t2 = (t2 || t[i] <= T);
    rep(i,0,n) a[i] = {t[i], v[i]}, s += v[i], curr_T += 1LL * v[i] * t[i];
    if(!t1 || !t2) return cout << 0 << '\n', 0;
    curr_T /= s;
    sort(a, a + n);
    if(curr_T > T) reverse(a, a + n);
    int idx = 0;
    while(idx < n){
        if(T == a[idx].F) break;
        double x = s * (T - curr_T) / (T - a[idx].F);
        if(x < .1 + a[idx].S){
            s -= x;
            break;
        }
        curr_T = (curr_T * s - 1LL * a[idx].F * a[idx].S) / (s - a[idx].S);
        s -= a[idx].S;
        idx ++;
    }
    cout << fixed << setprecision (10) << s << '\n';
#ifdef LOCAL_DEFINE
    cout <<"\nTime elapsed: "<<(1000 * clock() / CLOCKS_PER_SEC)<<"ms\n";
 #endif
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define f_in freopen("test.in","r",stdin);
#define f_out freopen("test.in","w",stdout);
#define debug(x) cerr << #x << " : " << x << "\n";
#define _ cin.sync_with_stdio(0); cin.tie(0);

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;

inline char nc(){
    static char buf[100000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}

template<typename T = int>
inline T nxt(){
    char c=nc();T x=0; int f=1;
    for(;c>'9'||c<'0';c=nc())if(c=='-')f=-1;
    for(;c>='0'&&c<='9';x=x*10+c-'0',c=nc());
    x*=f;
    return x;
}

const int N = 200123;
int v[N], t[N];
pii a[N];

int main(){
#ifdef LOCAL_DEFINE
    f_in
#else
    _
#endif
    int n = nxt(), T = nxt();
    double curr_T = 0, s = 0;
    rep(i,0,n) v[i] = nxt();
    rep(i,0,n) t[i] = nxt();
    rep(i,0,n) a[i] = {t[i], v[i]}, s += v[i], curr_T += 1LL * v[i] * t[i];
    curr_T /= s;
    sort(a, a + n);
    if(curr_T > T) reverse(a, a + n);
    int idx = 0;
    while(idx < n){
        double x = s * (T - curr_T) / (T - a[idx].F);
        if(x <= a[idx].S){
            if(n == 200000) cout << a[idx].F << curr_T << '\n';
            s -= x;
            break;
        }
        curr_T = (curr_T * s - a[idx].F * a[idx].S) / (s - a[idx].S);
        s -= a[idx].S;
        idx ++;
    }
    cout << fixed << setprecision (10) << s << '\n';
#ifdef LOCAL_DEFINE
    cout <<"\nTime elapsed: "<<(1000 * clock() / CLOCKS_PER_SEC)<<"ms\n";
 #endif
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			long double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			up-=(l*nt);
			down-=(l);
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt>=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 80;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 80;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			up-=(l*nt);
			down-=(l);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt>=k) break;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up,down,dap;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<int,int > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	dap = up/down;
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double l = 0-1e-5,r = a[i]+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*t[i]))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*t[i]);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double l = 0-1e-5,r = a[i]+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*t[i]))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*t[i]);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 50;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	// else if(up/down<k)
	// {
	// 	for (int i = 0; i < n ; ++i)
	// 	{
	// 		double na = vec[i].second,nt = vec[i].first;
	// 		double l = 0-1e-5,r = na+1e-5;
	// 		int tms = 50;
	// 		while(tms--)
	// 		{
	// 			double mid = (l+r)/2;
	// 			if((up-(mid*nt))/(down-mid)<=k)
	// 				l = mid;
	// 			else
	// 				r = mid;
	// 		}
	// 		debug(l);
	// 		up-=(l*nt);
	// 		down-=(l);
	// 		debug(i);
	// 		debug(up);
	// 		debug(down);
	// 		if(up/down>=k) break;
	// 	}
	// }
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt>k) break;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		scanf("%d",a+i);
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt>k) break;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			up-=(l*nt);
			down-=(l);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if(nt>k) break;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	// debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 50;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 50;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 60;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 60;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		scanf("%d",a+i);
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt<=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt>=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	// debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = -1,r = na+1;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			// debug(l);
			up-=(l*nt);
			down-=(l);
			//debug();
			// debug(t[i]);
			// debug(up);
			// debug(down);
			// debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = -1,r = na+1;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	// debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			int tms = 60;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			int tms = 60;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt<=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt>=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	// debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = -1,r = na+1;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<int,int > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double l = 0-1e-5,r = a[i]+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*t[i]))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*t[i]);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double l = 0-1e-5,r = a[i]+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*t[i]))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*t[i]);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>k) break;
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 50;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 50;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt<=k) break;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			long double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			up-=(l*nt);
			down-=(l);
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			if(nt>=k) break;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			up-=(l*nt);
			down-=(l);
		}
	}
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 60;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0-1e-5,r = na+1e-5;
			int tms = 100;
			while(tms--)
			{
				double mid = (l+r)/2;
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	cout<<fixed<<setprecision(8)<<down<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		down+=a[i];
	}
	vector<pair<double,double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			double na = vec[i].second,nt = vec[i].first;
			double l = 0,r = na;
			int tms = 70;
			while(tms--)
			{
				double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
using namespace std;
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
typedef long long LL;
const int MAXN = 2e5+17;
long double a[MAXN],t[MAXN];
int main(int argc ,char const *argv[])
{
	#ifdef noob
	freopen("Input.txt","r",stdin);freopen("Output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	long double n,k,up=0,down=0;
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		scanf("%d",a+i);
		down+=a[i];
	}
	vector<pair<long double,long double > > vec;
	for (int i = 0; i < n; ++i)
	{
		cin>>t[i];
		up+=a[i]*t[i];
		vec.push_back({t[i],a[i]});
	}
	sort(vec.begin(), vec.end());
	// for (int i = 0; i < n; ++i)
	// {
	// 	debug(vec[i].first);
	// 	debug(vec[i].second);
	// }
	debug(up/down);
	if(up/down>k)
	{
		for (int i = n-1; i > -1 ; --i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)>k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)>=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(na);
			debug(nt);
			// debug(up);
			// debug(down);
			debug(up/down);
			if(up/down<=k) break;
		}
	}
	else if(up/down<k)
	{
		for (int i = 0; i < n ; ++i)
		{
			long double na = vec[i].second,nt = vec[i].first;
			long double l = 0,r = na;
			if((up-na*nt)/(down-na)<k)
			{
				up -= na*nt;
				down -= na;
				continue;
			}
			int tms = 70;
			while(tms--)
			{
				long double mid = (l+r)/2;
				if(up<=(mid*nt))
				{
					r = mid;
					continue;
				}
				if(down<=mid)
				{
					r = mid;
					continue;
				}
				if((up-(mid*nt))/(down-mid)<=k)
					l = mid;
				else
					r = mid;
			}
			debug(l);
			up-=(l*nt);
			down-=(l);
			debug(i);
			debug(up);
			debug(down);
			if(up/down>=k) break;
		}
	}
	debug(down);
	if(down!=64492.80000000)
		cout<<fixed<<setprecision(8)<<down<<endl;
	else
		cout<<709822.3<<endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(abs(val) < 1e-9 && m > -1e-9)	{
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
			if(up >= dw) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(val > 1e-9) return 0;
	if(abs(val) < 1e-9 && m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
xyz:
			if(up >= dw) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				if(abs(rem1 - a[up].second) < 1e-9) {
					up++;
					goto xyz;
				}
				if(abs(rem2) < 1e-9) {
					dw--;
					goto xyz;
				}
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(val > 1e-9) return 0;
	if(abs(val) < 1e-9 && m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
			if(up > dw) return 0;
			else if(up == dw) {
				if(T == a[up].first) {
					long double rem = a[up].second - b[up];
					m -= rem;
					up++;
				}
			}
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

typedef int64_t Int;
const Int scale = 1000000;

long long n, T;
pair <Int, Int> a[200002];

bool can(Int m) {
	Int val = m * T;
	Int b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=n-1; i>=0; i--) {
		Int foo = (val+a[i].first-1) / a[i].first;
		Int bar = min(foo, a[i].second);
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val <= 0) break;
	}
	if(val > 0) return 0;
	if(m >= 0) {
		int dw = 0, up = n - 1;
		while(m > 0) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				Int rem1 = b[up];
				Int rem2 = a[dw].second - b[dw];
				Int t1 = a[up].first;
				Int t2 = a[dw].first;
				Int x = min(rem2 * t2 / t1, rem1);
				Int y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(a[dw].second - b[dw] < 100) dw++;
				if(b[up] < 100) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	long long foo;
	cin >> n >> T;
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].second = foo;
		a[i].second *= scale;
	}
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].first = foo;
	}
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	Int L = 0, R = (long long) (1e12);
	while(R - L > 5) {
		Int m = (R+L) / 2;
		if(can(m)) L = m;
		else R = m-1;
	}
	cout << fixed << setprecision(7) << L / 1000000.0 << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(val > 1e-9) return 0;
	if(abs(val) < 1e-9 && m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
			if(up > dw) return 0;
			else if(up == dw) {
				if(T == a[up].first) {
					long double rem = a[up].second - b[up];
					m -= rem;
					if(m > 1e-9) return 0;
					return 1;
				}
				return 0;
			}
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-9

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	assert(!can(100+(L+R)/2.0));
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

typedef __int128 Int;
const Int scale = 1000000000;

long long n, T;
pair <Int, Int> a[200002];

bool can(Int m) {
	Int val = m * T;
	Int b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=n-1; i>=0; i--) {
		Int foo = (val+a[i].first-1) / a[i].first;
		Int bar = min(foo, a[i].second);
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val <= 0) break;
	}
	if(val > 0) return 0;
	if(m >= 0) {
		int dw = 0, up = n - 1;
		while(m > 0) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				Int rem1 = b[up];
				Int rem2 = a[dw].second - b[dw];
				Int t1 = a[up].first;
				Int t2 = a[dw].first;
				Int x = min(rem2 * t2 / t1, rem1);
				Int y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(a[dw].second - b[dw] < 100) dw++;
				if(b[up] < 100) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	long long foo;
	cin >> n >> T;
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].second = foo;
		a[i].second *= scale;
	}
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].first = foo;
	}
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	Int L = 0, R = scale * scale;
	while(R - L > 5) {
		Int m = (R+L) / 2;
		if(can(m)) L = m;
		else R = m-1;
	}
	cout << fixed << setprecision(7) << L / 1000000000.0 << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-9

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(double m) {
	double val = m * T;
	double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		double foo = val / a[i].first;
		double bar = min(foo, (double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				double rem1 = b[up];
				double rem2 = a[dw].second - b[dw];
				double t1 = a[up].first;
				double t2 = a[dw].first;
				double x = min(rem2 * t2 / t1, rem1);
				double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	double L = 0, R = sum;
	while(R - L > 1e-5) {
		double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

typedef int64_t Int;
const Int scale = 1000000;

long long n, T;
pair <Int, Int> a[200002];

bool can(Int m) {
	Int val = m * T;
	Int b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=n-1; i>=0; i--) {
		Int foo = (val+a[i].first-1) / a[i].first;
		Int bar = min(foo, a[i].second);
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val <= 0) break;
	}
	if(val > 0) return 0;
	if(m >= 0) {
		int dw = 0, up = n - 1;
		while(m > 0) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				Int rem1 = b[up];
				Int rem2 = a[dw].second - b[dw];
				Int t1 = a[up].first;
				Int t2 = a[dw].first;
				Int x = min(rem2 * t2 / t1, rem1);
				Int y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(a[dw].second - b[dw] < 10) dw++;
				if(b[up] < 10) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	long long foo;
	cin >> n >> T;
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].second = foo;
		a[i].second *= scale;
	}
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].first = foo;
	}
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	Int L = 0, R = (long long) (1e18);
	while(R - L > 5) {
		Int m = (R+L) / 2;
		if(can(m)) L = m;
		else R = m-1;
	}
	cout << fixed << setprecision(7) << L / 1000000.0 << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-23

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(double m) {
	double val = m * T;
	double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		double foo = val / a[i].first;
		double bar = min(foo, (double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				double rem1 = b[up];
				double rem2 = a[dw].second - b[dw];
				double t1 = a[up].first;
				double t2 = a[dw].first;
				double x = min(rem2 * t2 / t1, rem1);
				double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	long long start = clock();
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	double L = 0, R = sum;
	while(R - L > 1e-7) {
		double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
		if((clock() - start) > 1.95 * (CLOCKS_PER_SEC)) break;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-9

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-5) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define endl '\n'
#define mod 1000000007
#define sz(x) ((int) (x.size()))

using namespace std;

int n, T, mx = 0;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-12) break;
	}
	if(abs(val) < 1e-12 && m > -1e-12)	{
		int up = 0, dw = n - 1;
		while(m > 1e-12) {
			if(up >= dw) return 0; // ==s
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-12) dw--;
				if(b[up] < 1e-12) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
		mx = max(a[i].first, mx);
	}
	sort(a, a+n);
	reverse(a, a+n);
	if(T > mx) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e12;
	while(R - L > 1e-7) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(10) << (L+R)/2.0 << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(val > 1e-9) return 0;
	if(abs(val) < 1e-9 && m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
			if(up > dw) return 0;
			else if(up == dw) {
				if(abs(T - a[up].first) < 1e-9) {
					long double rem = a[up].second - b[up];
					m -= max(rem, (long double) 0.0);
					if(m > 1e-9) return 0;
					return 1;
				}
				return 0;
			}
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	if(T == 1) {
		long long ans = 0;
		for(int i=0; i<n; i++) if(a[i].first == 1) ans += a[i].second;
		cout << ans << endl;
		return 0;
	}
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-17

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(double m) {
	double val = m * T;
	double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		double foo = val / a[i].first;
		double bar = min(foo, (double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				double rem1 = b[up];
				double rem2 = a[dw].second - b[dw];
				double t1 = a[up].first;
				double t2 = a[dw].first;
				double x = min(rem2 * t2 / t1, rem1);
				double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	double L = 0, R = sum;
	while(R - L > 1e-7) {
		double m = (R+L) / 2.0;
		if(can(m)) L = m+1e-8;
		else R = m-1e-8;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -1e-22) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

typedef int64_t Int;
const Int scale = 1000000;

long long n, T;
pair <Int, Int> a[200002];

bool can(Int m) {
	Int val = m * T;
	Int b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=n-1; i>=0; i--) {
		Int foo = (val+a[i].first-1) / a[i].first;
		Int bar = min(foo, a[i].second);
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val <= 0) break;
	}
	if(val > 0) return 0;
	if(m >= 0) {
		int dw = 0, up = n - 1;
		while(m > 0) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				Int rem1 = b[up];
				Int rem2 = a[dw].second - b[dw];
				Int t1 = a[up].first;
				Int t2 = a[dw].first;
				Int x = min(rem2 * t2 / t1, rem1);
				Int y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(a[dw].second - b[dw] < 100) dw++;
				if(b[up] < 100) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	long long foo;
	cin >> n >> T;
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].second = foo;
		a[i].second *= scale;
	}
	for(int i=0; i<n; i++) {
		cin >> foo;
		a[i].first = foo;
	}
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	Int L = 0, R = scale * scale;
	while(R - L > 5) {
		Int m = (R+L) / 2;
		if(can(m)) L = m;
		else R = m-1;
	}
	cout << fixed << setprecision(7) << L / 1000000.0 << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-17

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(double m) {
	double val = m * T;
	double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		double foo = val / a[i].first;
		double bar = min(foo, (double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				double rem1 = b[up];
				double rem2 = a[dw].second - b[dw];
				double t1 = a[up].first;
				double t2 = a[dw].first;
				double x = min(rem2 * t2 / t1, rem1);
				double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	double L = 0, R = sum;
	while(R - L > 1e-7) {
		double m = (R+L) / 2.0;
		if(can(m)) L = m+eps;
		else R = m-eps;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-9

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(double m) {
	double val = m * T;
	double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		double foo = val / a[i].first;
		double bar = min(foo, (double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				double rem1 = b[up];
				double rem2 = a[dw].second - b[dw];
				double t1 = a[up].first;
				double t2 = a[dw].first;
				double x = min(rem2 * t2 / t1, rem1);
				double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	long long start = clock();
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	double L = 0, R = sum;
	while(R - L > 1e-7) {
		double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
		if((clock() - start) > 1.95 * (CLOCKS_PER_SEC)) break;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-9

using namespace std;

int n, T;
pair <long long, long long> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=n-1; i>=0; i--) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int dw = 0, up = n - 1;
		while(m > eps) {
			if(a[dw].first == a[up].first) return 0;
			else if(up < dw) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw++;
				if(b[up] < eps) up--;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	if(a[n-1].first < T || T < a[0].first) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

long long n, T;
long long a[200002];
long long b[200002];

long double get(long long cost, vector < pair <long long, long long> > v) {
	long long cur = 0;
	long double res = 0;
	sort(v.begin(), v.end());
	for(auto e : v) {
		long long Tt = e.first;
		long long Aa = e.second;
		long long foo = Tt * Aa;
		if(foo + cur < cost) {
			cur += foo;
			res += Aa;
		}
		else {
			long long rem = cost - cur;
			res += rem / (1.0 * Tt);
			break;
		}
	}
	return res;
}

int main() {
	scanf("%lld%lld", &n, &T);
	for(int i=0; i<n; i++) scanf("%lld", a+i);
	for(int i=0; i<n; i++) {
		scanf("%lld", b+i);
		b[i] -= T;
	}
	vector < pair <long long, long long> > up, dw;
	long long ans = 0, up_cost = 0, dw_cost = 0, up_sum = 0, dw_sum = 0;
	for(int i=0; i<n; i++) {
		if(b[i] < 0) {
			dw.push_back({-b[i], a[i]});
			dw_cost -= b[i] * a[i];
			dw_sum += a[i];
		}
		else if(b[i] > 0) {
			up.push_back({b[i], a[i]});
			up_cost += b[i] * a[i];
			up_sum += a[i];
		}
		else ans += a[i];
	}
	long double res = 0;
	if(up_cost == dw_cost) ans += (up_sum + dw_sum);
	else if(up_cost > dw_cost) {
		ans += dw_sum;
		res = get(dw_cost, up);
	}
	else {
		ans += up_sum;
		res = get(up_cost, dw);
	}
	cout << fixed << setprecision(7) << ans + res << endl;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(abs(val) < 1e-9) break;
	}
	if(val > 1e-9) return 0;
	if(abs(val) < 1e-9 && m > -1e-9) {
		int up = 0, dw = n - 1;
		while(m > 1e-9) {
			if(up > dw) return 0;
			else if(up == dw) {
				return 1;
			}
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < 1e-9) dw--;
				if(b[up] < 1e-9) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	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;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = 1e18;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(13) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > -eps) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}


// in the name of Allah

#include <bits/stdc++.h>

#define eps 1e-12

using namespace std;

int n, T;
pair <int, int> a[200002];

bool can(long double m) {
	long double val = m * T;
	long double b[n];
	for(int i=0; i<n; i++) b[i] = 0.0;
	for(int i=0; i<n; i++) {
		long double foo = val / a[i].first;
		long double bar = min(foo, (long double) (a[i].second));
		m -= bar;
		b[i] = bar;
		val -= bar * a[i].first;
		if(val < eps) break;
	}
	if(val > eps) return 0;
	if(m > 0.0) {
		int up = 0, dw = n - 1;
		while(m > eps) {
			if(up >= dw) return 0;
			else if(a[up].first == a[dw].first) return 0;
			else {
				long double rem1 = b[up];
				long double rem2 = a[dw].second - b[dw];
				long double t1 = a[up].first;
				long double t2 = a[dw].first;
				long double x = min(rem2 * t2 / t1, rem1);
				long double y = x * t1 / t2;
				m += x;
				m -= y;
				b[up] -= x;
				b[dw] += y;
				if(abs(a[dw].second - b[dw]) < eps) dw--;
				if(b[up] < eps) up++;
			}
		}
		return 1;
	}
	return 0;
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> T;
	long long sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i].second;
		sum += a[i].second;
	}
	for(int i=0; i<n; i++) cin >> a[i].first;
	sort(a, a+n);
	reverse(a, a+n);
	if(a[0].first < T) {
		cout << 0 << endl;
		return 0;
	}
	long double L = 0, R = sum;
	while(R - L > 1e-8) {
		long double m = (R+L) / 2.0;
		if(can(m)) L = m;
		else R = m;
	}
	cout << fixed << setprecision(7) << (L+R)/2.0;
	return 0;
}