#include <bits/stdc++.h>

using namespace std;

#define ALL(x) x.begin(), x.end()

int main(){
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
    int n, x, best = 1, worst = 0;
    cin >> n >> x;
    vector <int> a(n), b(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n; i++)
        cin >> b[i];

    multiset <int> s;
    for (int i = 0; i < n; i++){
        s.insert(b[i]);
    }

    for (int i = 0; i < n; i++){
        int y = a[i];
        auto it = s.lower_bound(x - y);
        if (it != s.end()){
            worst += 1;
            s.erase(it);
        }
    }
    cout << best << " " << worst << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ALL(x) x.begin(), x.end()

int main(){
    int n, x, best = 1, worst = 0;
    cin >> n >> x;
    vector <int> a(n), b(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n; i++)
        cin >> b[i];

    multiset <int> s;
    for (int i = 0; i < n; i++){
        s.insert(b[i]);
    }

    for (int i = 0; i < n; i++){
        int y = a[i];
        auto it = s.lower_bound(x - y);
        if (it != s.end()){
            worst += 1;
            s.erase(it);
        }
    }
    cout << best << " " << worst << endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<deque>
#include<stack>
#include<numeric>
#include<functional>
#include<fstream>
const long double PI(acosl(-1.0));

#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(x) x.begin(), x.end()
#define sqr(x) ((x)*(x))
#define F first
#define S second
#define eps 1e-7
#define inf (ll)(1e9+7)
#define infll (ll)(1e18+3)

using namespace std;

int main()
{
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("hull.in", "r", stdin);
	//freopen("hull.out", "w", stdout);
#endif
	int n, m, k;
	cin >> n >> k;
	int a[100001], b[100001];

	multiset<int> s;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
		s.insert(b[i]);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w = a[i];
		w = k - w;
		if (s.find(w) != s.end())
		{
			ans++;
			s.erase(s.find(w));
		}
		else
		{
			s.insert(w);
			auto it = s.find(w);
			it++;
			if (it != s.end())
			{
				ans++;
				s.erase(it);
				s.erase(s.find(w));
			}
			else
			{
				s.erase(s.begin());
			}
		}
	}
	cout << 1 << ' ' << ans << endl;

	return 0;

}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<deque>
#include<stack>
#include<numeric>
#include<functional>
#include<fstream>
const long double PI(acosl(-1.0));

#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(x) x.begin(), x.end()
#define sqr(x) ((x)*(x))
#define F first
#define S second
#define eps 1e-7
#define inf (ll)(1e9+7)
#define infll (ll)(1e18+3)

using namespace std;

int main()
{
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("hull.in", "r", stdin);
	//freopen("hull.out", "w", stdout);
#endif
	int n, m, k;
	cin >> n >> k;
	int a[100001], b[100001];

	multiset<int> s;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
		s.insert(b[i]);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w = a[i];
		w = k - w;
		if (s.find(w) != s.end())
		{
			ans++;
			s.erase(s.find(w));
		}
		else
		{
			s.insert(w);
			auto it = s.find(w);
			it++;
			if (it != s.end())
			{
				ans++;
				s.erase(it);
				s.erase(s.find(w));
			}
		}
	}
	cout << 1 << ' ' << ans << endl;

	return 0;

}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<deque>
#include<stack>
#include<numeric>
#include<functional>
#include<fstream>
const long double PI(acosl(-1.0));

#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(x) x.begin(), x.end()
#define sqr(x) ((x)*(x))
#define F first
#define S second
#define eps 1e-7
#define inf (ll)(1e9+7)
#define infll (ll)(1e18+3)

using namespace std;

int main()
{
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("hull.in", "r", stdin);
	//freopen("hull.out", "w", stdout);
#endif
	int n, m, k;
	cin >> n >> k;
	int a[100001], b[100001];

	multiset<int> s;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
		s.insert(b[i]);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w = a[i];
		w = k - w;
		if (s.find(w) != s.end())
		{
			ans++;
			s.erase(s.find(w));
		}
		else
		{
			s.insert(w);
			auto it = s.find(w);
			it++;
			if (it != s.end())
			{
				ans++;
				s.erase(it);
				s.erase(s.find(w));
			}
			else
			{
				s.erase(s.begin());
				s.erase(s.find(w));
			}
		}
	}
	cout << 1 << ' ' << ans << endl;

	return 0;

}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<deque>
#include<stack>
#include<numeric>
#include<functional>
#include<fstream>
const long double PI(acosl(-1.0));

#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(x) x.begin(), x.end()
#define sqr(x) ((x)*(x))
#define F first
#define S second
#define eps 1e-7
#define inf (ll)(1e9+7)
#define infll (ll)(1e18+3)

using namespace std;

int main()
{
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("hull.in", "r", stdin);
	//freopen("hull.out", "w", stdout);
#endif
	int n, m, k;
	cin >> n >> k;
	int a[100001];

	multiset<int> s;
	for (int i = 0; i < n; i++)
		scanf("%d ", &a[i]);
	for (int i = 0; i < n; i++)
	{
		int b;
		scanf("%d ", &b);
		s.insert(b);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w = a[i];
		w = k - w;
		if (s.find(w) != s.end())
		{
			ans++;
			s.erase(s.find(w));
		}
		else
		{
			s.insert(w);
			auto it = s.find(w);
			it++;
			if (it != s.end())
			{
				ans++;
				s.erase(it);
				s.erase(s.find(w));
			}
			else
			{
				s.erase(s.begin());
				s.erase(s.find(w));
			}
		}
	}
	cout << 1 << ' ' << ans << endl;

	return 0;

}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<deque>
#include<stack>
#include<numeric>
#include<functional>
#include<fstream>
const long double PI(acosl(-1.0));

#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(x) x.begin(), x.end()
#define sqr(x) ((x)*(x))
#define F first
#define S second
#define eps 1e-7
#define inf (ll)(1e9+7)
#define infll (ll)(1e18+3)

using namespace std;

int main()
{
	//ios_base::sync_with_stdio(0);
	//cin.tie(0);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("hull.in", "r", stdin);
	//freopen("hull.out", "w", stdout);
#endif
	int n, m, k;
	cin >> n >> k;
	int a[100001], b[100001];

	multiset<int> s;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
		s.insert(b[i]);
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w = a[i];
		if (s.find(w) != s.end())
		{
			ans++;
			s.erase(s.find(w));
		}
		else
		{
			s.insert(w);
			auto it = s.find(w);
			it++;
			if (it != s.end())
			{
				ans++;
				s.erase(it);
				s.erase(s.find(w));
			}
		}
	}
	cout << 1 << ' ' << ans << endl;

	return 0;

}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll a[100001],m,n,b[100001];
 cin>>n>>m;
 ll pos=0,pos1=0,mx=m-1;
 ll mn=m+100000;
for(int i=0;i<n;i++)
{
    cin>>a[i];
}
 for(int i=0;i<n;i++)
{
    cin>>b[i];
}
 for(int i=0;i<n;i++)
{
    if(a[i]+b[i]<=mn && a[i]+b[i]>=m)
    {
        mn=a[i]+b[i];
    pos=i+1;
    }
    if(a[i]+b[i]>mx && a[i]+b[i]>=m)
        {
        mx=a[i]+b[i];
    pos1=i+1;
        }
}
cout<<pos1<<" "<<pos;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll m,n,sum,a[100001],b[100001];
vector<ll>s1,s;
 cin>>n>>m;
for(int i=0;i<n;i++)
{
    cin>>sum;
    s1.pb(sum);
}
 for(int i=0;i<n;i++)
{
    cin>>sum;
    s.pb(sum);
}
sort(s1);
sort(s);

 for(int i=0;i<n;i++)
{
    a[i]=s1[i];
    b[n-i-1]=s[i];
}
int i=0,j=0,t=0;
while(i<n && j<n)
{
    if(a[i]+b[j]>=m)
    {
        i++;
        j++;
        t++;
    }
    else if(i<n-1 && a[i]<a[i+1])
    {
        i++;
    }
    else
    {
        j++;
    }
}

cout<<1<<" "<<t;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll m,n,sum,t=0;
vector<ll>a,b;
 cin>>n>>m;
 ll t1=0;
for(int i=0;i<n;i++)
{
    cin>>sum;
    a.pb(sum);
}
 for(int i=0;i<n;i++)
{
    cin>>sum;
    b.pb(sum);
}
sort(a);
sort(b);

 for(int i=0;i<n;i++)
{
    int x=a[i];
    int y=b[n-i-1];
    if(x+y<m)
    {
    t++;
    }
}
 for(int i=0;i<n;i++)
{
    int x=b[i];
    int y=a[n-i-1];
    if(x+y<m)
        t1++;
}
t=min(t,t1);
cout<<1<<" "<<n-t;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll a[100001],m,n,sum,b[100001];
vector<ll>s;
 cin>>n>>m;
 ll pos=0,pos1=0,mx=m-1;
for(int i=0;i<n;i++)
{
    cin>>a[i];
}
 for(int i=0;i<n;i++)
{
    cin>>b[i];
    sum=b[i]+a[i];
    s.pb(sum);
}
sort(s);
 for(int i=0;i<n;i++)
{
    if( s[i]>=m)
    {
    pos=n-i;
    break;
    }
}

cout<<1<<" "<<pos;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll m,n,sum,a[100001],b[100001];
vector<ll>s1,s;
 cin>>n>>m;
for(int i=0;i<n;i++)
{
    cin>>sum;
    s1.pb(sum);
}
 for(int i=0;i<n;i++)
{
    cin>>sum;
    s.pb(sum);
}
sort(s1);
sort(s);

 for(int i=0;i<n;i++)
{
    a[i]=s1[i];
    b[n-i-1]=s[i];
}
int i=0,j=0,t=0;
while(i<n && j<n)
{
    if(a[i]+b[j]>=m)
    {
        i++;
        j++;
        t++;
    }
    else if(a[i]<b[j])
    {
        i++;
    }
    else
    {
        j++;
    }
}

cout<<1<<" "<<t;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll m,n,sum,a[100001],b[100001];
vector<ll>s1,s;
 cin>>n>>m;
for(int i=0;i<n;i++)
{
    cin>>sum;
    s1.pb(sum);
}
 for(int i=0;i<n;i++)
{
    cin>>sum;
    s.pb(sum);
}
sort(s1);
sort(s);

 for(int i=0;i<n;i++)
{
    a[i]=s1[i];
    b[n-i-1]=s[i];
}
int i=0,j=0,t=0;
while(i<n && j<n)
{
    if(a[i]+b[j]>=m)
    {
        i++;
        j++;
        t++;
    }
    else if(i<n-1 && a[i]<=a[i+1])
    {
        i++;
    }
    else
    {
        j++;
    }
}

cout<<1<<" "<<t;
return 0;
}


#include<bits/stdc++.h>

#include<math.h>
using namespace std;
#define ll            int long long
#define ld            long double
#define ull           unsigned long long
#define pi            acos(-1)
#define pb            push_back
#define pbk           pop_back
#define mp            make_pair
#define gcd(a,b)      __gcd(a,b)
#define lcd(a,b)     (a*b)/gcd(a,b)
#define M             10000001
#define sort(t)       sort(t.begin(),t.end())
//div div[100][100];
//int br[100][100];
//int a[8]= {-1,-1,-1,0,0,1,1,1};
//int b[8]= {-1,0,1,-1,1,-1,0,1};

int main()
{
ll a[100001],m,n,b[100001];
 cin>>n>>m;
 ll pos=0,pos1=0,mx=m-1;
 ll mn=m+100000;
for(int i=0;i<n;i++)
{
    cin>>a[i];
}
 for(int i=0;i<n;i++)
{
    cin>>b[i];
}
 for(int i=0;i<n;i++)
{
    if( a[i]+b[i]>=m)
    {
    pos=i+1;
    }
}
 for(int i=n-1;i>=0;i--)
{
    if(a[i]+b[i]>=m)
        {
    pos1=i+1;
        }
}
cout<<pos1<<" "<<pos;
return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v[2][MAXN];
int n;

bool ok(int k, int scr) {
	assert(k<n);
	for(int i = k-1; i>=0; --i) if(v[0][i] + v[1][k-1-i] > scr) return false;
	return true;
}

bool ok2(int k, int scr) {
	assert(k<=n);
	FOR0(i,k) if(v[0][n-1-i] + v[1][n-k+i] < scr) return false;
	return true;
}

int main() {
	NSYNC;
	int minp;
	cin >> n >> minp;
	FOR0(i,2) {
		FOR0(j,n) cin >> v[i][j];
		sort(v[i],v[i]+n);
	}

	int scr = v[0][n-1] + v[1][n-1];
	int b = 0;
	int e = n;
	while(b<e) {
		int m = (b+e)/2;
		if(!ok(m,scr)) e = m;
		else b = m+1;
	}
	--e;
	e = max(e,0);
	int bestp = n - e;

	b = 0;
	e = n+1;
	while(b<e) {
		int m = (b+e)/2;
		if(!ok2(m,minp)) e = m;
		else b = m+1;
	}
	--e;
	e = max(e,0);
	int worstp = e;

	cout << bestp << " " << worstp << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}

	ll v1=INF,v2=INF;
	TRAV(it,st1) {
		ll x = *it;
		// DBG(x);
		auto it2 = st2.lower_bound(minp-x);
		if(it2 == st2.end()) continue;
		ll y = *it2;
		// DBG(y);
		// DBG(x+y);
		if(x+y < v1+v2) {
			v1 = x;
			v2 = y;
		}

	}
	// DBG(v1); DBG(v2);
	st1.erase(st1.find(v1));
	st2.erase(st2.find(v2));
	minp = v1+v2;

	// DBG(v1); DBG(v2);

	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v[2][MAXN];

bool ok(int k, int scr) {
	assert(k<n);
	for(int i = k-1; i>=0; --i) if(v[0][i] + v[1][k-1-i] > scr) return false;
	return true;
}

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	FOR0(i,2) {
		FOR0(j,n) cin >> v[i][j];
		sort(v[i],v[i]+n);
	}
	int scr = v[0][n-1] + v[1][n-1];
	int bestp = n;

	int b = 0;
	int e = n;
	while(b<e) {
		int m = (b+e)/2;
		if(!ok(m,scr)) e = m;
		else b = m+1;
	}
	--e;
	e = max(e,0);
	bestp = n - e;

	int worstp = 1;
	FOR0(i,n) {
		int minv = minp - v[0][i];
		int idx = lower_bound(v[1],v[1]+n,minv) - v[1];
		if(idx < n) {
			worstp = max(worstp, min(n-1-i,n-1-idx)+1);
		}
	}
	cout << bestp << " " << worstp << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v[2][MAXN];

bool ok(int k, int scr) {
	for(int i = k-1; i>=0; --i) if(v[0][i] + v[1][k-1-i] > scr) return false;
	return true;
}

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	FOR0(i,2) {
		FOR0(j,n) cin >> v[i][j];
		sort(v[i],v[i]+n);
	}
	int scr = v[0][n-1] + v[1][n-1];
	int bestp = n;

	int b = 0;
	int e = n;
	while(b<e) {
		int m = (b+e)/2;
		if(!ok(m,scr)) e = m;
		else b = m+1;
	}
	--e;
	e = max(e,0);
	bestp = n - e;

	int worstp = 1;
	FOR0(i,n) {
		int minv = minp - v[0][i];
		int idx = lower_bound(v[1],v[1]+n,minv) - v[1];
		if(idx < n) {
			worstp = max(worstp, min(n-1-i,n-1-idx)+1);
		}
	}
	cout << bestp << " " << worstp << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}

	int v1=INF,v2=INF;

	TRAV(it,st1) {
		int x = *it;
		auto it2 = st2.find(minp-x);
		if(it2 == st2.end()) continue;
		int y = *it2;
		if(x+y < v1+v2) {
			v1 = x;
			v2 = y;
		}
	}
	st1.erase(st1.find(v1));
	st2.erase(st2.find(v2));
	minp = v1+v2;

	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}

	ll v1=INF,v2=INF;
	TRAV(it,st1) {
		ll x = *it;
		auto it2 = st2.find(minp-x);
		if(it2 == st2.end()) continue;
		ll y = *it2;
		if(x+y < v1+v2) {
			v1 = x;
			v2 = y;
		}
	}
	st1.erase(st1.find(v1));
	st2.erase(st2.find(v2));
	minp = v1+v2;

	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}

	int v1=INF,v2=INF;

	TRAV(it,st1) {
		int x = *it;
		auto it2 = st2.find(minp-x);
		if(it2 == st2.end()) continue;
		int y = *it2;
		if(x+y < v1+v2) {
			v1 = x;
			v2 = y;
		}
	}
	minp = v1+v2;

	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;

	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}
	ll vv1=INF,vv2=INF;
	TRAV(it,st1) {
		ll x = *it;
		// DBG(x);
		auto it2 = st2.lower_bound(minp-x);
		if(it2 == st2.end()) continue;
		ll y = *it2;
		// DBG(y);
		// DBG(x+y);
		if(x+y < vv1+vv2) {
			vv1 = x;
			vv2 = y;
		}

	}
	// DBG(v1); DBG(v2);
	st1.erase(st1.find(vv1));
	st2.erase(st2.find(vv2));
	minp = vv1+vv2;
	// DBG(v1); DBG(v2);
	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	int p1 = pos;

	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v2[i]);
		st2.insert(v1[i]);
	}
	vv1=INF,vv2=INF;
	TRAV(it,st1) {
		ll x = *it;
		// DBG(x);
		auto it2 = st2.lower_bound(minp-x);
		if(it2 == st2.end()) continue;
		ll y = *it2;
		// DBG(y);
		// DBG(x+y);
		if(x+y < vv1+vv2) {
			vv1 = x;
			vv2 = y;
		}

	}
	// DBG(v1); DBG(v2);
	st1.erase(st1.find(vv1));
	st2.erase(st2.find(vv2));
	minp = vv1+vv2;
	// DBG(v1); DBG(v2);
	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	int p2 = pos;

	cout << " " << max(p1,p2) << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v[2][MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	FOR0(i,2) {
		FOR0(j,n) cin >> v[i][j];
		sort(v[i],v[i]+n);
	}
	int scr = v[0][n-1] + v[1][n-1];
	int bestp = n;
	for(int i=n-2; i>=0; --i) {
		int maxv = scr - v[0][i];
		int idx = lower_bound(v[1], v[1]+n-1, maxv+1) - v[1] -1;
		if(idx >= i) {
			bestp = n-1-i;
			break;
		}
	}
	int worstp = 1;
	FOR0(i,n) {
		int minv = minp - v[0][i];
		int idx = lower_bound(v[1],v[1]+n,minv) - v[1];
		if(idx < n) {
			worstp = max(worstp, min(n-1-i,n-1-idx)+1);
		}
	}
	cout << bestp << " " << worstp << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}

	int v1=INF,v2=INF;

	TRAV(it,st1) {
		int x = *it;
		int y;
		if(x >= minp) {
			y = *st2.begin();
		}
		else {
			auto it2 = st2.find(minp-x);
			if(it2 == st2.end()) continue;
			y = *it2;
		}
		if(x+y < v1+v2) {
			v1 = x;
			v2 = y;
		}
	}
	minp = v1+v2;

	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v[2][MAXN];
int n;

bool ok(int k, int scr) {
	assert(k<n);
	for(int i = k-1; i>=0; --i) if(v[0][i] + v[1][k-1-i] > scr) return false;
	return true;
}

int main() {
	NSYNC;
	int minp;
	cin >> n >> minp;
	FOR0(i,2) {
		FOR0(j,n) cin >> v[i][j];
		sort(v[i],v[i]+n);
	}
	int scr = v[0][n-1] + v[1][n-1];
	int bestp = n;

	int b = 0;
	int e = n;
	while(b<e) {
		int m = (b+e)/2;
		if(!ok(m,scr)) e = m;
		else b = m+1;
	}
	--e;
	e = max(e,0);
	bestp = n - e;

	int worstp = 1;
	FOR0(i,n) {
		int minv = minp - v[0][i];
		int idx = lower_bound(v[1],v[1]+n,minv) - v[1];
		if(idx < n) {
			worstp = max(worstp, min(n-1-i,n-1-idx)+1);
		}
	}
	cout << bestp << " " << worstp << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

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

const int MAXN = 100010;
int v1[MAXN], v2[MAXN];

int main() {
	NSYNC;
	int n, minp;
	cin >> n >> minp;
	multiset<int> st1, st2;
	FOR0(i,n) {
		cin >> v1[i];
		st1.insert(v1[i]);
	}
	FOR0(i,n) {
		cin >> v2[i];
		st2.insert(v2[i]);
	}
	int pts = *st1.rbegin() + *st2.rbegin();
	st1.erase(st1.find(*st1.rbegin()));
	st2.erase(st2.find(*st2.rbegin()));
	int pos = 1;
	TRAV(it,st1) {
		int x = *it;
		int rem = pts - x;
		auto it2 = st2.lower_bound(rem+1);
		if(it2 == st2.begin()) {
			++pos;
			st2.erase(st2.find(*st2.rbegin()));
		}
		else {
			--it2;
			st2.erase(it2);
		}
	}
	cout << pos;
	st1.clear();
	st2.clear();
	FOR0(i,n) {
		st1.insert(v1[i]);
		st2.insert(v2[i]);
	}
	TRAV(it,st1) {
		int x = *it;
		if(st2.count(minp-x)) {
			st1.erase(st1.find(x));
			st2.erase(st2.find(minp-x));
			// cout << "sel " << x << " " << minp-x << endl;
			break;
		}
	}
	pos = n;
	TRAV(it,st1) {
		int x = *it;
		if(x>=minp) {
			st2.erase(st2.begin());
		}
		else {
			int rem = minp - x;
			auto it2 = st2.lower_bound(rem);
			if(it2 == st2.end()) {
				--pos;
				st2.erase(st2.find(*st2.rbegin()));
			}
			else st2.erase(it2);
		}
	}
	cout << " " << pos << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n);i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define INF	1e9
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

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

const int N = 1e5 + 5;
int n , x;
int a[N] , b[N];

int main()
{

#ifndef ONLINE_JUDGE
	//freopen("in.in", "r", stdin);
	//freopen("out.in", "w", stdout);
	//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#endif

    scanf("%d%d",&n,&x);

    loop(i,n)
        scanf("%d",&a[i]);

    loop(i,n)
        scanf("%d",&b[i]);

    sort(a,a+n);
    reverse(a,a+n);
    sort(b,b+n);
    int i = 0 , j = 0;
    while(j < n){
        if(a[i] + b[j] >= x)i++ , j++;
        else j++;
    }

    printf("1 %d\n",i);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n);i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define INF	1e9
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

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

const int N = 1e5 + 5;
int n , x;
int a[N] , b[N] , nxt[N];

int f(int x){
    if(x == nxt[x])return x;
    return nxt[x] = f(nxt[x]);
}

int main()
{

#ifndef ONLINE_JUDGE
	//freopen("in.in", "r", stdin);
	//freopen("out.in", "w", stdout);
	//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#endif

    scanf("%d%d",&n,&x);
    loop(i,n+1)
        nxt[i] = i;

    loop(i,n)
        scanf("%d",&a[i]);

    loop(i,n)
        scanf("%d",&b[i]);

    sort(a,a+n);
    sort(b,b+n);
    int worst = 0;
    loop(i,n){
        int idx = lower_bound(b , b+n , x - a[i]) - b;
        idx = f(idx);
        if(idx >= n)continue;
        worst++;
        nxt[idx] = idx+1;
    }

    printf("1 %d\n",worst);

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n);i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define INF	1e9
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

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

const int N = 1e5 + 5;
int n , x;
int a[N] , b[N] , nxt[N];

int f(int x){
    if(x == nxt[x])return x;
    return nxt[x] = f(nxt[x]);
}

int main()
{

#ifndef ONLINE_JUDGE
	//freopen("in.in", "r", stdin);
	//freopen("out.in", "w", stdout);
	//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#endif

    scanf("%d%d",&n,&x);
    loop(i,n+1)
        nxt[i] = i;

    loop(i,n)
        scanf("%d",&a[i]);

    loop(i,n)
        scanf("%d",&b[i]);

    int worst = 0;
    loop(i,n){
        int idx = lower_bound(b , b+n , x - a[i]) - b;
        idx = f(idx);
        if(idx == n)continue;
        worst++;
        nxt[idx] = idx+1;
    }

    printf("1 %d\n",worst);

    return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int cur = n;
	for(int i = 0; i < n; i++){
		for(int j = cur - 1; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j;
			}
		}
	}
	printf("1 %d\n", cnt);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int cur = n - 1;
	int pos = 0;
	for(int i = pos; i < n; i++){
		for(int j = cur; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j - 1;
				pos = i;
			}
		}
	}
	printf("1 %d\n", cnt);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int cur = n - 1;
	int pos = 0;

	for(int i = pos; i < n; i++){
		for(int j = cur; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j - 1;
				break;
			}
		}
	}
	printf("1 %d\n", cnt);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int j = n - 1;
	int i = 0;

	while(j >= 0 && i < n){
		if(a[i] + b[j] >= k){
			cnt++;
			i++; j--;
		}
		else j--;
	}
	/*
	for(int i = pos; i < n; i++){
		for(int j = cur; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j - 1;
				break;
			}
		}
	}
	*/
	printf("1 %d\n", cnt);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int cur = n - 1;
	while(cur > 0 && a[n - 1] + b[cur - 1] >= k) cur--;

	int i = n - 2;
	cur++;
	while(i >= 0 && cur < n){
		if(a[i] + b[cur] >= k){
			cnt++;
			i--; cur++;
			continue;
		}
		cur++;

	}
	printf("1 %d\n", cnt + 1);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int j = n - 1;
	int i = 0;

	while(j >= 0 && i < n){
		if(a[i] + b[j] >= k){
			cnt++;
			i++; j--;
		}
		else i++;
	}
	/*
	for(int i = pos; i < n; i++){
		for(int j = cur; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j - 1;
				break;
			}
		}
	}
	*/
	printf("1 %d\n", cnt);

	return 0;
}


#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define sqr(x) ((x * x))
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define frp freopen("input.txt", "r", stdin); \
		    freopen("output.txt", "w", stdout);

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

const int maxn = (int)1e5 + 6;
const int inf = (int)1e9 * 2;
const int mod = (int)1e9 + 7;

int n, m, k;
int a[maxn], b[maxn], cnt;

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
	}
	for(int i = 0; i < n; i++){
		scanf("%d", b + i);
	}
	sort(a, a + n);
	sort(b, b + n);
	int cur = n - 1;
	int pos = 0;

	for(int i = pos; i < n; i++){
		for(int j = cur; j >= 0; j--){
			if(a[i] + b[j] >= k){
				cnt++;
				cur = j - 1;
				pos = i + 1;
			}
		}
	}
	printf("1 %d\n", cnt);

	return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAX = 100100;
int a[MAX], b[MAX];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin>>n>>x;
    for(int i = 0; i < n; i++)
        cin>>a[i];
    for(int i = 0; i < n; i++)
        cin>>b[i];
    sort(a, a + n);
    sort(b, b + n);
    int cnt = 0;
    for(int i = 0, j = n - 1; i < n && ~j; j--){
        while(i < n && ~j && a[i] + b[j] < x) i++;
        cnt += (i < n && ~j);
        i++;
    }
    cout<<1<<' '<<cnt<<endl;
    return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAX = 100100;
int arr[MAX];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin>>n>>x;
    for(int i = 0; i < n; i++)
        cin>>arr[i];
    for(int i = 0; i < n; i++)
        cin>>arr[n], arr[i] += arr[n];
    int mn = 0, mx = 0;
    for(int i = 0; i < n; i++) if(arr[i] >= x){
        if(arr[i] > arr[mx])
            mx = i;
        if(arr[i] < arr[mn])
            mn = i;
    }
    cout<<mx + 1<<' '<<mn + 1<<endl;
    return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAX = 100100;
int arr[MAX];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin>>n>>x;
    for(int i = 0; i < n; i++)
        cin>>arr[i];
    for(int i = 0; i < n; i++)
        cin>>arr[n], arr[i] = -arr[i] - arr[n];
    sort(arr, arr + n);
    int mn = 0, mx = 0;
    for(int i = 0; i < n; i++) if(-arr[i] >= x){
        if(-arr[i] > -arr[mx])
            mx = i;
        if(-arr[i] <= -arr[mn])
            mn = i;
    }
    cout<<mx + 1<<' '<<mn + 1<<endl;
    return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAX = 100100;
int arr[MAX];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin>>n>>x;
    for(int i = 0; i < n; i++)
        cin>>arr[i];
    for(int i = 0; i < n; i++)
        cin>>arr[n], arr[i] += arr[n];
    int mn = 0, mx = 0;
    for(int i = 0; i < n; i++) if(arr[i] >= x){
        if(arr[i] > arr[mx])
            mx = i;
        if(arr[i] <= arr[mn])
            mn = i;
    }
    cout<<mx + 1<<' '<<mn + 1<<endl;
    return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
const int MAX = 100100;
int a[MAX], b[MAX];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, x;
    cin>>n>>x;
    for(int i = 0; i < n; i++)
        cin>>a[i];
    for(int i = 0; i < n; i++)
        cin>>b[i];
    sort(a, a + n);
    sort(b, b + n);
    int cnt = 0;
    for(int i = 0, j = n - 1; i < n && ~j; j--){
        while(i < n && ~j && a[i] + b[j] < x) i++;
        cnt += (i < n && ~j);
    }
    cout<<1<<' '<<cnt<<endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define MAX 100005

int main() {
	//freopen("INPUT.INP", "rt", stdin);
	long n, vmin, temp, pmax, pmin, cmin, cmax;

	long p[MAX], q[MAX];
	cin >> n >> vmin;
	for (int i = 0; i < n; i++)
	{
		cin >> p[i];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> q[i];
	}

	sort(p, p + n);
	sort(q, q + n);

	long res = 0;
	for (int i = n - 1; i >= 0; i--)
	{
		int j = 0;
		while (j < n && p[i] + q[j] < vmin){
			j++;
		}
		if (j < n) {
			j++;
			res++;
		}
	}
	cout << 1 << " " << res << endl;
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

const int N = 100000;

int n, limit, a[N], b[N];

int main() {
    scanf("%d%d", &n, &limit);
    for (int i = 0; i < n; ++ i) {
        scanf("%d", a + i);
    }
    sort(a, a + n);
    for (int i = 0; i < n; ++ i) {
        scanf("%d", b + i);
    }
    sort(b, b + n);
    int result = 0;
    for (int i = n - 1, j = 0; i >= 0; -- i) {
        while (j < n && a[i] + b[j] < limit) {
            j ++;
        }
        if (j < n) {
            j ++;
            result ++;
        }
    }
    printf("1 %d\n", result);
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define MAX 100005

int main() {
	freopen("INPUT.INP", "rt", stdin);
	long n, vmin, temp, pmax, pmin, cmin, cmax;

	long p[MAX], q[MAX];
	cin >> n >> vmin;
	for (int i = 0; i < n; i++)
	{
		cin >> p[i];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> q[i];
	}

	sort(p, p + n);
	sort(q, q + n);

	long res = 0;
	for (int i = n - 1, j = 0; i >= 0; --i)
	{
		while ((j < n) && (p[i] + q[j] < vmin)){
			j++;
		}
		if (j < n) {
			j++;
			res++;
		}
	}
	cout << 1 << " " << res << endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

#define MAX 100005

int main() {
	//freopen("INPUT.INP", "rt", stdin);
	int n, vmin, temp, pmax, pmin, cmin, cmax;

	int p[MAX], q[MAX];
	cin >> n >> vmin;
	for (int i = 0; i < n; i++)
	{
		cin >> p[i];
	}
	sort(p, p + n);
	for (int i = 0; i < n; i++)
	{
		cin >> q[i];
	}
	sort(q, q + n);
	int res = 0;
	for (int i = n - 1, j = 0; i >= 0; --i) {
		while (j < n && p[i] + q[j] < vmin) {
			j++;
		}
		if (j < n) {
			j++;
			res++;
		}
	}
	cout <<"1 " << res << endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
using namespace std;

#define MAX 100005

int main() {
	//freopen("INPUT.INP", "rt", stdin);
	long n, vmin, temp, pmax, pmin, cmin, cmax;

	long p[MAX];
	cin >> n >> vmin;
	for (int i = 0; i < n; i++)
	{
		cin >> p[i];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> temp;
		p[i] += temp;
	}
	pmax = p[0];
	cmin = -1;
	cmax = 0;
	pmin = -1;
	for (int i = 0; i < n; i++)
	{
		if (p[i] > pmax)
		{
			pmax = p[i];
			cmax = i;
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (p[i] >= vmin && (pmin == -1 || p[i] < pmin) && i != cmax)
		{
			pmin = p[i];
			cmin = i;
		}
	}
	cout << cmax + 1 << " "  << cmin + 1 << endl;
	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , nah1 , nah2 , nah3 = INF , in1 , in2 , nah4;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < nah3)
			nah1 = rt , nah2 = d[2][tr] , in1 = i , in2 = tr , nah3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);
	nah4 = n;
	for(int i = 1 ; i <= n ; i++)
	{
		if(d[1][i] + d[2][i] < nah3)
			nah4--;
	}

	cout << 1 << " " << nah4 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

vector <int> v;
int a = 1 , b , c , d[3][maxn] , n , m;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i] , d[j][i] += d[j-1][i];

	for(int i = 1 ; i <= n ;i++)
		v.pb(d[2][i]);

	sort(all(v));
	reverse(all(v));

	cout << a << " ";
	a = 0;
	for(int i = 0 ; i < sz(v) ; i++)
	{
		if(v[i] >= m)
			a = i;
	}
	cout << a+1 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , han1 , han2 , han3 = INF , in1 , in2 , han4;
int k;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < han3)
			han1 = rt , han2 = d[2][tr] , in1 = i , in2 = tr , han3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	han4 = n;

	for(int i = n ; i >= 1 ; i--)
	{
		if(d[2][1] + d[1][i] < han3)
		{
			k = i;
			break;
		}
	}

	reverse(d[2]+1 , d[2] + k+1);

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
	}

	cout << 1 << " " << han4 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 1,  b , c,  d[3][maxn] , n,  m;

int main()
{
	cin >> n >> m;

	b = n;

	for(int i = 1; i < 3 ; i++)
		for(int j = 1 ; j <= n ; j++)
			cin >> d[i][j];

	sort(d[1] , d[1] + n + 1);
	sort(d[2] , d[2] + n + 1);

	while(a <= n && b)
	{
		if(d[1][a] + d[2][b] >= m)	c++;
		a++ , b--;
	}

	cout << 1 << " " << c << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 1,  b , c,  d[3][maxn] , n,  m;

int main()
{
	cin >> n >> m;

	b = n;

	for(int i = 1; i < 3 ; i++)
		for(int j = 1 ; j <= n ; j++)
			cin >> d[i][j];

	sort(d[1] , d[1] + n + 1);
	sort(d[2] , d[2] + n + 1);

	while(a <= n && b)
	{
		if(d[1][a] + d[2][b] >= m)	c++,b--;
		a++;
	}

	cout << 1 << " " << c << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , han1 , han2 , han3 = INF , in1 , in2 , han4;
int k;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < han3)
			han1 = rt , han2 = d[2][tr] , in1 = i , in2 = tr , han3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	han4 = n;

	for(int i = n ; i >= 1 ; i--)
	{
		if(d[2][1] + d[1][i] < han3)
		{
			k = i;
			break;
		}
	}

	reverse(d[2]+1 , d[2] + k+1);

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
			else
			break;
	}

	cout << 1 << " " << han4 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

vector <int> v;
int a = 1 , b , c , d[3][maxn] , n , m;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i] , d[j][i] += d[j-1][i];

	for(int i = 1 ; i <= n ;i++)
		v.pb(d[2][i]);

	sort(all(v));
	reverse(all(v));

	cout << a << " ";

	for(int i = 0 ; i < sz(v) ; i++)
	{
		if(v[i] >= m)
			a = i;
	}
	cout << a+1 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

vector <int> v;
int a = 0 , b , c , d[3][maxn] , n , m , tr;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	for(int i = 1 ; i <= 2 ; i++)
		sort(d[i] , d[i] + n + 1);

	for(int i = 1 ; i <= n ; i++)
		d[2][i] += d[1][i];

	for(int i = 1 ; i <= n ; i++)
		if(d[2][i] >= m)
		{
			a = i;
			break;
		}

	tr = n - a;

	if(d[2][a] == m)
		tr++;

	cout << 1 << " " << tr << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , han1 , han2 , han3 = INF , in1 , in2 , han4;
int k;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < han3)
			han1 = rt , han2 = d[2][tr] , in1 = i , in2 = tr , han3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	han4 = n;

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
			else
			break;
	}

	cout << 1 << " " << han4 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , han1 , han2 , han3 = INF , in1 , in2 , han4;
int k;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < han3)
			han1 = rt , han2 = d[2][tr] , in1 = i , in2 = tr , han3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	han4 = n;

	for(int i = n ; i >= 1 ; i--)
	{
		if(d[2][1] + d[1][i] < han3)
		{
			k = i;
			break;
		}
	}

	reverse(d[2] , d[2] + n + 1 - k);

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
	}

	cout << 1 << " " << han4 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

vector <int> v;
int a = 1 , b , c , d[3][maxn] , n , m;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i] , d[j][i] += d[j-1][i];

	for(int i = 1 ; i <= n ;i++)
		v.pb(d[2][i]);

	sort(all(v));

	cout << a << " ";

	for(int i = 0 ; i < sz(v) ; i++)
		if(v[i] >= m)
			a++;

	cout << a-1 << endl;

	return 0;
}


//~  Inshaallah
/*
ID: omarmuh1
PROG: test
LANG: C++
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <ctime>
#include <iomanip>
#include <string.h>
#include <stdio.h>
#include <set>

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pop_back
#define pii pair<int ,int>
#define pil pair<int , ll>
#define pli pair<ll , int>
#define pll pair<ll , ll>
#define mid(x , y)	(x+y)/2
#define sz(x) int(x.size())
#define db		cout << "****" << endl;
#define all(x) 	x.begin() , x.end()
#define lgn 	19
#define minn	1009
#define maxn 	200007
#define INF 	1000000009
#define LLINF 	1000000000000000009
#define tr(i, c) for(typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define Help_me  ios_base::sync_with_stdio(false);

template<class T> bool umin(T& a, T b) { if(a > b){ a = b;return 1;}return 0;}
template<class T> bool umax(T& a, T b) { if(a < b){ a = b;return 1;}return 0;}

//~ ifstream cin("test.in");
//~ ofstream cout("test.out");

int a = 0 , b , c , d[3][maxn] , n , m , tr , han1 , han2 , han3 = INF , in1 , in2 , han4 , uy1;
int k;

int main()
{
	cin >> n >> m;

	for(int j = 1 ; j <= 2 ; j++)
		for(int i = 1 ; i <= n ; i++)
			cin >> d[j][i];

	sort(d[2]+1 , d[2] + n + 1);

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[1][i]);
		int tr = lower_bound(d[2]+1 , d[2] + n + 1 , rt) - d[2];

		if(rt + d[2][tr] < han3)
			han1 = rt , han2 = d[2][tr] , in1 = i , in2 = tr , han3 = rt + d[2][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	han4 = n;

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
	}

	for(int i = 1; i  <= n ; i++)
	{
		int rt = abs(m - d[2][i]);
		int tr = lower_bound(d[1]+1 , d[1] + n + 1 , rt) - d[1];

		if(rt + d[1][tr] < han3)
			han1 = rt , han2 = d[1][tr] , in1 = i , in2 = tr , han3 = rt + d[1][tr];
	}

	d[1][in1] = d[2][in2] = INF;

	sort(d[1] + 1 , d[1] + n + 1);
	sort(d[2] + 1 , d[2] + n + 1);

	uy1 = han4;
	han4 = n;

	for(int i = 1 ; i <= n ; i++)
	{
		if(d[2][i] + d[1][i] < han3)
			han4--;
	}

	cout << 1 << " " << max(uy1 , han4) << endl;

	return 0;
}


//lxrtxdy!
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <string>
#include <math.h>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <algorithm>
#include <stdio.h>
#include <cstring>                    //  For memset
#include <sstream>
#include <numeric>

using namespace std;

#define lop(i,n) for(int i = 0 ; i < n ;i++)
#define VI    vector<int>
#define VLL    vector<ll>
#define VPI    vector< pair<int , int> >
#define VII    vector<VI>
#define all(v)    v.begin() , v.end()
#define SORT(v)    sort(all(v))
#define ll    long long
#define ull unsigned long long
#define scni(x)    scanf("%d",&x)                //  int
#define scnll(x)    scanf("%lld",&x)            //  ll
#define scnd(x)    scanf("%lf",&x)            //  double
#define prnti(x)    printf("%d\n",x)                //  int
#define prntll(x)    printf("%lld",x)                //  ll  NOTE :: lld <<for>> long long
#define prntd(x)    printf("%.9f",x)                //  int
#define sz(x)  x.size()
#define SPC  <<" "<<
#define pp push_back
#define P pair<int , int>
#define mp make_pair

const double EPS = 1e-9;
const double PI = 3.14159265359;

//  O( n * log(log(n)) )
vector<ll> primes;
void GeneratingPrimes(int top){
    vector<bool> p (top+1 , 1);
//    vector<ll> primes;
    p[0] = p[1] = 0;

    for(int i = 2; i <= sqrt(top) ; i++){
        if(p[i]){
            for(int j = i*i ; j <= top ; j+=i){
                p[j]=0;
            }
        }
    }
    lop(i , top+1)
        if(p[i])primes.push_back(i);
//    return primes;
}

ll gcd(ll a ,ll b){return (b==0)?a : gcd(b , a%b);}
ll lcm(ll a, ll b){return (a * b) / gcd(a , b);}

void EXTgcd(ll a , ll b , int & x0 , int & y0){
    if(b==0){ x0 =1 , y0 = 0; return; }
    EXTgcd( b , a%b , x0 , y0 );
    ll x1 = y0;
    ll y1 = x0 - (a/b) * y0;
    x0 = x1;
    y0 = y1;
}

long long power(long long n, long long p , ll mod) {
    if (!p)
        return 1;
    long long ans = 1;
    while (p > 1) {
        if (p & 1)
            ans = (ans * n) % mod;
        n = (n * n) % mod;
        p /= 2;
    }
    return (ans * n) % mod;
}

double dist(double a , double b , double x, double y){ return sqrt( pow( a-x ,2) + pow( b-y ,2) ); }

double dist3(double a , double b , double c , double x , double y ,double z ){ return sqrt( pow( a-x ,2) + pow( b-y ,2) + pow( c-z ,2)); }

int xadd[9]= { 1 , -1 , 0 , 1 , -1 , 0 , 1 , -1 , 0 };
int yadd[9]= { 1 , -1 , 0 ,-1 ,  0 , 1 , 0 ,  1, -1 };

int xx[4]={0 , 1 , 0 , -1};
int yy[4]={1 , 0 , -1 , 0};

#define no  { cout<<"NO\n"; return 0; }
#define yes { cout<<"YES\n";return 0; }
#define _1 { cout<<"-1\n";return 0;}

ll const N = 1e5 + 10;
ll const mod = 1e9 + 7;
ll const INF = 1e12;

///////////////////////////////////////////////////////////////////

int n , x;
multiset<int>a,b;

int main(){
	cin >> n >> x;
	lop(i,n){int z; cin >> z; a.insert(z);}
	lop(i,n){int z; cin >> z; b.insert(z);}

	cout << 1 << " ";
	P mini = mp(99999999 , 99999999);

	for(int q:a){
		int nd = x-q;
		auto it = b.lower_bound(nd);
		if(it!=b.end() && q + *it < mini.first+mini.second ){
			mini = mp(q , *it);
		}
	}

	a.erase(a.find(mini.first));
	b.erase(b.find(mini.second));

	int up=0 , me = mini.first + mini.second;

	for(int q:a){
		int nd = me - q;
		auto it = b.lower_bound(nd);
		if(it!=b.end()){
			b.erase(it);
			up++;
		}
	}

	cout << up+1;
return 0;}
//orzlxr!//hello


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;

bool cmp(int x, int y)
{
	return x > y;
}

int main()
{
	map<int, int>m;
	int ans = 0, flag, t;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &b[i]);
	}
	sort(a, a + n,cmp);
	sort(b, b + n);
	t = 0;
	for (int i = 0; i < n; ++i)
	{
		flag = 0;
		for (int j = t; j < n; ++j)
		{
			if (a[i] + b[j] >= k)
			{
				flag = 1;
				ans++;
				t = j + 1;
				break;
			}
		}
		if (!flag)
			break;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000];

int main()
{
	map<int, int>m;
	int k, ans = 0;
	int cnt = 0;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n);
	sort(b, b + n);
	for (int i = 0; i < n; ++i)
	{
		if (a[i] + b[i] < k)
			ans++;
		else
			break;
	}
	cout << "1 " << n - ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;
int p[200000], used[200000];
bool check(int x, int y)
{
	return x + y >= k;
}

bool find(int x)
{
	for (int i = 0; i < n; ++ i)
	{
		if (check(a[x], b[i]) && !used[i])
		{
			used[i] = 1;
			if (p[i] == -1 || find(p[i]))
			{
				p[i] = x;
				return true;
			}
		}
	}
	return false;
}

int main()
{
	int ans = 0;
	int cnt = 0;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n);
	sort(b, b + n);
	memset(p, -1, sizeof(p));
	for (int i = 0; i < n; ++i)
	{
		memset(used, 0, sizeof(used));
		if (find(i))
			ans++;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;
int p[200000], used[200000];
bool check(int x, int y)
{
	return x + y >= k;
}
bool cmp(int x, int y)
{
	return x > y;
}
bool find(int x)
{
	for (int i = 0; i < n; ++ i)
	{
		if (check(a[x], b[i]) && !used[i])
		{
			used[i] = 1;
			if (p[i] == -1 || find(p[i]))
			{
				p[i] = x;
				return true;
			}
		}
	}
	return false;
}

int main()
{
	int ans = 0;
	int cnt = 0;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n, cmp);
	sort(b, b + n);
	memset(p, -1, sizeof(p));
	for (int i = 0; i < n; ++i)
	{
		memset(used, 0, sizeof(used));
		if (a[i]>=k||find(i))
			ans++;
		//else
			//break;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;
int p[200000], used[200000];
bool check(int x, int y)
{
	return x + y >= k;
}
bool cmp(int x, int y)
{
	return x > y;
}
bool find(int x)
{
	for (int i = 0; i < n; ++ i)
	{
		if (check(a[x], b[i]) && !used[i])
		{
			used[i] = 1;
			if (p[i] == -1 || find(p[i]))
			{
				p[i] = x;
				return true;
			}
		}
	}
	return false;
}

int main()
{
	int ans = 0;
	int cnt = 0;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n, cmp);
	sort(b, b + n);
	memset(p, -1, sizeof(p));
	for (int i = 0; i < n; ++i)
	{
		memset(used, 0, sizeof(used));
		if (a[i]>=k||find(i))
			ans++;
		else
			break;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;

bool cmp(int x, int y)
{
	return x > y;
}

int main()
{
	map<int, int>m;
	int ans = 0, flag, t;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", &b[i]);
	}
	sort(a, a + n,cmp);
	sort(b, b + n);
	t = 0;
	for (int i = 0; i < n; ++i)
	{
		flag = 0;
		for (int j = t; j < n; ++j)
		{
			if (a[i] + a[j] >= k)
			{
				flag = 1;
				ans++;
				t = j + 1;
				break;
			}
		}
		if (!flag)
			break;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;
int p[200000], used[200000];
bool check(int x, int y)
{
	return x + y >= k;
}
bool cmp(int x, int y)
{
	return x > y;
}
bool find(int x)
{
	for (int i = 0; i < n; ++ i)
	{
		if (check(a[x], b[i]) && !used[i])
		{
			used[i] = 1;
			if (p[i] == -1 || find(p[i]))
			{
				p[i] = x;
				return true;
			}
		}
	}
	return false;
}

int main()
{
	int ans = 0;
	int cnt = 0;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n);
	sort(b, b + n,cmp);
	memset(p, -1, sizeof(p));
	for (int i = 0; i < n; ++i)
	{
		memset(used, 0, sizeof(used));
		if (a[i]>=k||find(i))
			ans++;
		else
			break;
	}

	cout << "1 " << ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000];

int main()
{
	map<int, int>m;
	int k, ans = 0;
	int cnt = 0;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n);
	sort(b, b + n);
	for (int i = 0; i < n; ++i)
	{
		if (a[i] + b[i] < k)
			ans++;
		else
			break;
	}
	cout << "1" << n - ans;
}


#include<iostream>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<functional>
#include<cmath>
#include<map>
using namespace std;
int n, a[200000], b[200000], k;
int p[200000], used[200000];
bool check(int x, int y)
{
	return x + y >= k;
}
bool cmp(int x, int y)
{
	return x > y;
}
bool find(int x)
{
	for (int i = 0; i < n; ++ i)
	{
		if (check(a[x], b[i]) && !used[i])
		{
			used[i] = 1;
			if (p[i] == -1 || find(p[i]))
			{
				p[i] = x;
				return true;
			}
		}
	}
	return false;
}

int main()
{
	int ans = 0;
	int cnt = 0;
	cin >> n >> k;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for (int i = 0; i < n; ++i)
		scanf("%d", &b[i]);
	sort(a, a + n,cmp);
	sort(b, b + n,cmp);
	memset(p, -1, sizeof(p));
	for (int i = 0; i < n; ++i)
	{
		memset(used, 0, sizeof(used));
		if (find(i))
			ans++;
		else
			break;
	}

	cout << "1 " << ans;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <map>
using namespace std;
int main(){
    int n,x;
    while(cin>>n>>x){
        int r1[100003],r2[100003];
        map<int,int> mop;
        for(int i=0; i<n; i++) cin>>r1[i];
        for(int i=0; i<n; i++) cin>>r2[i];
        sort(r1,r1+n);
        sort(r2,r2+n);
        int place=0,j=0;
        for(int i=n-1; i>=0&&j<n; i--){
            while(r1[i]+r2[j]<x && j<n) j++;
            if(r1[i]+r2[j]>=x) place++;
            j++;
        }
        cout<<"1 "<<place<<endl;
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <map>
using namespace std;
int main(){
    int n,x;
    while(cin>>n>>x){
        int r1[100003],r2[100003];
        for(int i=0; i<n; i++) cin>>r1[i];
        for(int i=0; i<n; i++) cin>>r2[i];
        sort(r1,r1+n);
        sort(r2,r2+n);
        int place=0,j=n-1;
        for(int i=0; i<n&&j>=0; i++){
            while(r1[i]+r2[j]<x && j>0) j--;
            if(r1[i]+r2[j]>=x) place++;
            j--;
        }
        cout<<"1 "<<place<<endl;
    }
}


//lxrtxdy!
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <string>
#include <math.h>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <algorithm>
#include <stdio.h>
#include <cstring>                    //  For memset
#include <sstream>
#include <numeric>

using namespace std;

#define lop(i,n) for(int i = 0 ; i < n ;i++)
#define VI    vector<int>
#define VLL    vector<ll>
#define VPI    vector< pair<int , int> >
#define VII    vector<VI>
#define all(v)    v.begin() , v.end()
#define SORT(v)    sort(all(v))
#define ll    long long
#define ull unsigned long long
#define scni(x)    scanf("%d",&x)                //  int
#define scnll(x)    scanf("%lld",&x)            //  ll
#define scnd(x)    scanf("%lf",&x)            //  double
#define prnti(x)    printf("%d\n",x)                //  int
#define prntll(x)    printf("%lld",x)                //  ll  NOTE :: lld <<for>> long long
#define prntd(x)    printf("%.9f",x)                //  int
#define sz(x)  x.size()
#define SPC  <<" "<<
#define pp push_back
#define P pair<int , int>
#define mp make_pair

const double EPS = 1e-9;
const double PI = 3.14159265359;

//  O( n * log(log(n)) )
vector<ll> primes;
void GeneratingPrimes(int top){
    vector<bool> p (top+1 , 1);
//    vector<ll> primes;
    p[0] = p[1] = 0;

    for(int i = 2; i <= sqrt(top) ; i++){
        if(p[i]){
            for(int j = i*i ; j <= top ; j+=i){
                p[j]=0;
            }
        }
    }
    lop(i , top+1)
        if(p[i])primes.push_back(i);
//    return primes;
}

ll gcd(ll a ,ll b){return (b==0)?a : gcd(b , a%b);}
ll lcm(ll a, ll b){return (a * b) / gcd(a , b);}

void EXTgcd(ll a , ll b , int & x0 , int & y0){
    if(b==0){ x0 =1 , y0 = 0; return; }
    EXTgcd( b , a%b , x0 , y0 );
    ll x1 = y0;
    ll y1 = x0 - (a/b) * y0;
    x0 = x1;
    y0 = y1;
}

long long power(long long n, long long p , ll mod) {
    if (!p)
        return 1;
    long long ans = 1;
    while (p > 1) {
        if (p & 1)
            ans = (ans * n) % mod;
        n = (n * n) % mod;
        p /= 2;
    }
    return (ans * n) % mod;
}

double dist(double a , double b , double x, double y){ return sqrt( pow( a-x ,2) + pow( b-y ,2) ); }

double dist3(double a , double b , double c , double x , double y ,double z ){ return sqrt( pow( a-x ,2) + pow( b-y ,2) + pow( c-z ,2)); }

int xadd[9]= { 1 , -1 , 0 , 1 , -1 , 0 , 1 , -1 , 0 };
int yadd[9]= { 1 , -1 , 0 ,-1 ,  0 , 1 , 0 ,  1, -1 };

int xx[4]={0 , 1 , 0 , -1};
int yy[4]={1 , 0 , -1 , 0};

#define no  { cout<<"NO\n"; return 0; }
#define yes { cout<<"YES\n";return 0; }
#define _1 { cout<<"-1\n";return 0;}

ll const N = 1e5 + 10;
ll const mod = 1e9 + 7;
ll const INF = 1e12;

///////////////////////////////////////////////////////////////////

int n , x;
multiset<int>a,b;

int main(){
	cin >> n >> x;
	lop(i,n){int z; cin >> z; a.insert(z);}
	lop(i,n){int z; cin >> z; b.insert(z);}

	cout << 1 << " ";
	P mini = mp(99999999 , 99999999);

	for(int q:a){
		int nd = x-q;
		auto it = b.lower_bound(nd);
		if(it!=b.end() && q + *it < mini.first+mini.second ){
			mini = mp(q , *it);
		}
	}

	a.erase(a.find(mini.first));
	b.erase(b.find(mini.second));

	int up=0 , me = mini.first + mini.second;

	for(int q:a){
		int nd = me - q;
		auto it = b.lower_bound(nd);
		if(it!=b.end()){
			b.erase(it);
			up++;
		}
	}

	cout << up+1;
return 0;}
//orzlxr!//hello//hello


#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

const int N = 100010;
int n, A, a[N], b[N];

int main(void) {
  scanf("%d%d", &n, &A);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i);
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; ++i)
    scanf("%d", b + i);
  sort(b + 1, b + 1 + n);
  int ans = 0, cnt = n;
  for (int i = 1; i <= n; ++i)
    if (a[i] + b[cnt] >= A) --cnt;
  ans = n - cnt;
  cnt = n;
  for (int i = 1; i <= n; ++i)
    if (b[i] + a[cnt] >= A) --cnt;
  ans = max(ans, n - cnt);
  printf("1 %d\n", ans);

  return 0;
}


#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;

const int N = 100010;
int n, A, a[N], b[N];

int main(void) {
  scanf("%d%d", &n, &A);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i);
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    a[i] += x;
  }
  sort(a + 1, a + 1 + n);
  int loc = 1;
  while (loc <= n && a[loc] < A) ++loc;
  printf("1 %d\n", n - loc + 1);

  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

bool comp(pair<int, int>a, pair<int, int>b){
    return (a.first+a.second)<(b.first+b.second);
}

int main()
{
    int n, x;

    scanf("%d %d", &n, &x);

    vector<pair<int, int> >rez(n);
    for(int i=0; i<n; i++){
        scanf("%d", &rez[i].first);
    }for(int i=0; i<n; i++){
        scanf("%d", &rez[i].second);
    }

    sort(rez.begin(), rez.end(), comp);

    int j=n, mi, ma;
    for(int i=0; i<n; i++){
        if(rez[i].first+rez[i].second>=x){
            mi=j;
            break;
        }
        j--;
    }
    ma=1;

    printf("%d %d", ma, mi);

    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

int main()
{
    int n, x;

    scanf("%d %d", &n, &x);

    vector<int>a(n);
    vector<int>b(n);
    for(int i=0; i<n; i++){
        scanf("%d", &a[i]);
    }for(int i=0; i<n; i++){
        scanf("%d", &b[i]);
    }

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    int j=n-1, k=0;

    for(int i=0; i<n; i++){
        if(a[i]+b[j]>=x){
            k++;
            j--;
        }
    }

    printf("1 %d", k);

    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppp pair<int, pp>
#define fi first
#define se second
#define esp 1e-9
#define MAXE 1000000001
#define mod 1000000007
#define N 555
typedef long long ll;
using namespace std;
int n, x;
int a[N], b[N];

int main() {
    //freopen("in.in", "r", stdin); //freopen("ou.ou", "w", stdout);
    ios::sync_with_stdio(false);
    cin>>n>>x;
    for (int i = 1; i <= n; i++) cin>>a[i];
    for (int i = 1; i <= n; i++) cin>>b[i];
    sort(a + 1, a + n + 1);
    sort(b + 1, b + n + 1);
    int best = n;
    int ret = 0;
    for (int i = 1; i <= n; i++) {
        if (a[i] + b[best] >= x) {
            ret++;
            best--;
        }
    }
    cout<<1<<" "<<ret;
    /**/return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppp pair<int, pp>
#define fi first
#define se second
#define esp 1e-9
#define MAXE 1000000001
#define mod 1000000007
#define N 100100
typedef long long ll;
using namespace std;
int n, x, z;
vector <int> a;
vector <int> b;

int main() {
    //freopen("in.in", "r", stdin); //freopen("ou.ou", "w", stdout);
    ios::sync_with_stdio(false);
    cin>>n>>x;
    for (int i = 1; i <= n; i++) {
        cin>>z;
        a.pb(z);
    }
    for (int i = 1; i <= n; i++) {
        cin>>z;
        b.pb(z);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    int u = -1, v = -1;
    int mat = 1000000001;
    for (int i = 0; i < n; i++) {
        int d = x - a[i];
        int pos = lower_bound(b.begin(), b.end(), d) - b.begin();
        if (pos != n) {
            if (a[i] + b[pos] < mat) {
                mat = a[i] + b[pos];
                u = i;
                v = pos;
            }
        }

    }
//    cout<<a[u]<<" "<<a[v]<<"\n";

    a.erase(a.begin() + u);
    b.erase(b.begin() + v);
    int cnt = 0;
    n--;
    for (int i = 0; i < n; i++)
        if (a[i] + b[i] < mat) cnt++;
    cout<<1<<" "<<n + 1 - cnt<<"\n";

    /**/return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppp pair<int, pp>
#define fi first
#define se second
#define esp 1e-9
#define MAXE 1000000001
#define mod 1000000007
#define N 100100
typedef long long ll;
using namespace std;
int n, x, z;
vector <int> a;
vector <int> b;

int main() {
    //freopen("in.in", "r", stdin); //freopen("ou.ou", "w", stdout);
    ios::sync_with_stdio(false);
    cin>>n>>x;
    for (int i = 1; i <= n; i++) {
        cin>>z;
        a.pb(z);
    }
    for (int i = 1; i <= n; i++) {
        cin>>z;
        b.pb(z);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    int u = -1, v = -1;
    int mat = 1000000001;
    for (int i = 0; i < n; i++) {
        int d = x - a[i];
        //cout<<"dm "<<i<<" "<<a[i]<<" "<<d<<"\n";

        int pos = lower_bound(b.begin(), b.end(), d) - b.begin();
        if (pos != n) {
            //cout<<b[pos]<<"\n";
            if (a[i] + b[pos] < mat) {
                mat = a[i] + b[pos];
                u = i;
                v = pos;
             //   cout<<"updated: "<<u<<" "<<v<<" "<<mat<<"\n";

            }
        }

    }

    a.erase(a.begin() + u);
    b.erase(b.begin() + v);

    /*for (int i = 0; i < a.size(); i++) cout<<a[i]<<" ";
    cout<<"\n";
    for (int i = 0; i < b.size(); i++) cout<<b[i]<<" ";
    cout<<"\n";
    cout<<"mat : "<<mat<<"\n";
    */

    n--;
    int cnt = 0;
    int best = n - 1;
    for (int i = 0; i < n; i++) {
        while (best > 0 && a[i] + b[best] > mat) best--;
        if (a[i] + b[best] > mat) break;
        if (a[i] + b[best] < mat) cnt++;
        best--;

        if (best == 0) break;
    }

    int cnt2 = 0;
    best = n - 1;
    for (int i = 0; i < n; i++) {
        while (best > 0 && b[i] + a[best] > mat) best--;
        if (b[i] + a[best] > mat) break;
        if (b[i] + a[best] < mat) cnt2++;
        best--;

        if (best == 0) break;
    }

    cout<<1<<" "<<n + 1 - min(cnt, cnt2)<<"\n";

    /**/return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppp pair<int, pp>
#define fi first
#define se second
#define esp 1e-9
#define MAXE 1000000001
#define mod 1000000007
#define N 100100
typedef long long ll;
using namespace std;
int n, x;
int a[N], b[N];

int main() {
    //freopen("in.in", "r", stdin); //freopen("ou.ou", "w", stdout);
    ios::sync_with_stdio(false);
    cin>>n>>x;
    for (int i = 1; i <= n; i++) cin>>a[i];
    for (int i = 1; i <= n; i++) cin>>b[i];
    sort(a + 1, a + n + 1);
    sort(b + 1, b + n + 1);
    int best = n;
    int ret = 0;
    for (int i = 1; i <= n; i++) {
        if (a[i] + b[best] >= x) {
            ret++;
            best--;
        }
    }
    cout<<1<<" "<<ret;
    /**/return 0;
}