#include <bits/stdc++.h>
using namespace std;
void calcu(vector<long long int> vec, long long int n);
const int MAXN = 412345;
const int MAXINT = 2047483098;
const long long int MOD = 1e9 + 7;
const int MAX = 1e4;
const long double pi = 2 * acosl(0);
const long double EPS = 1e-10;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool isPrime(long long unsigned n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int nCr(int n, int r) {
  int res = 1;
  if (n < r) return -1;
  r = min(r, n - r);
  for (long long unsigned int i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
bool comp(pair<long long int, long long int> &a,
          pair<long long int, long long int> &b) {
  if (a.first != b.first)
    return a.first > b.first;
  else {
    return a.second < b.second;
  }
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> vec(n);
  map<long long int, long long int> mp, kp;
  for (long long unsigned int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end());
  for (long long unsigned int i = 0; i < n; i++) {
    mp[vec[i]]++;
    if (mp[vec[i]] == 1) {
      kp[vec[i]] = i;
    }
  }
  vector<long long int> sum(n + 1, 0);
  for (long long unsigned int i = 0; i < n; i++) {
    sum[i + 1] = sum[i] + vec[i];
  }
  vector<pair<long long int, long long int> > ans(n);
  for (long long int i = 0; i < n; i++) {
    long long int a = vec[i];
    long long int pos = kp[vec[i]];
    if (pos == 0) {
      ans[i] = {mp[vec[i]], vec[i]};
      continue;
    }
    long long int left = 0;
    long long int right = pos;
    long long int answ = pos;
    while (left <= right) {
      long long int mid = (left + right) / 2;
      if (vec[i] * (pos - mid) - (sum[pos] - sum[mid]) <= k) {
        answ = mid;
        right = mid - 1;
      } else
        left = mid + 1;
    }
    ans[i] = {mp[vec[i]] + (pos - answ), vec[i]};
  }
  sort(ans.begin(), ans.end(), comp);
  cout << ans[0].first << " " << ans[0].second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
