/*
I n u z u k a S h i n o -w-
*/
#include <bits/stdc++.h>
using namespace std;
#define FILE(name) if (fopen(name".inp", "r")) freopen(name".inp", "r", stdin), freopen(name".out", "w", stdout)
#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
#define FOR(i, x, n) for (auto i = x; i <= n; ++i)
#define FOD(i, x, n) for (auto i = x; i >= n; --i)
#define REP(i, n) for (auto i = 0; i < n; ++i)
#define ALL(v) (v).begin(), (v).end()
#define fi first
#define se second
#define ll long long
#define pb push_back
#define vi vector<int>
#define pii pair<int, int>
const int N = 1e3 + 5;
const int maxn = 1e5 + 5;
const ll MOD = 1e9 + 7;
int n, k, a[maxn];
int main(){
cin.tie(0) -> sync_with_stdio(0);
FILE("TASK");
cin >>n >>k;
FOR(i, 1, n) cin >>a[i];
sort(a + 1, a + n + 1);
int cnt = 0, x = 0;
int l = 1;
ll up = 0;
FOR(r, 1, n){
if (r > 1) up += 1LL * (a[r] - a[r - 1]) * (r - l);
// cerr <<up <<' ';
while (up > k) up -= a[r] - a[l++];
int cur = r - l + 1;
if (cur > cnt) cnt = cur, x = a[r];
}
cout <<cnt <<' ' <<x <<'\n';
return 0;
}
LyoKCiAgICAgICAgSSBuIHUgeiB1IGsgYSAgUyBoIGkgbiBvIC13LQoKKi8KI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIEZJTEUobmFtZSkgaWYgKGZvcGVuKG5hbWUiLmlucCIsICJyIikpIGZyZW9wZW4obmFtZSIuaW5wIiwgInIiLCBzdGRpbiksIGZyZW9wZW4obmFtZSIub3V0IiwgInciLCBzdGRvdXQpCiNkZWZpbmUgVElNRSAoMS4wICogY2xvY2soKSAvIENMT0NLU19QRVJfU0VDKQojZGVmaW5lIEZPUihpLCB4LCBuKSBmb3IgKGF1dG8gaSA9IHg7IGkgPD0gbjsgKytpKQojZGVmaW5lIEZPRChpLCB4LCBuKSBmb3IgKGF1dG8gaSA9IHg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