#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
const long long MM = 998244353;
long long begtime = clock();
long long newmod(long long a, long long b) { return ((a % b) + b) % b; }
long long powM(long long a, long long b, long long m) {
  if (a <= 0) return 0;
  a %= m;
  if (!b) return 1;
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = ans * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return ans;
}
long long poww(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
template <typename T, typename F>
void chmax(T &a, F b) {
  if (b > a) a = b;
}
template <typename T, typename F>
void chmin(T &a, F b) {
  if (b < a) a = b;
}
const long long N = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  ;
  vector<long long> pre(n + 1);
  for (long long i = 0; i < n; i++) {
    pre[i + 1] = pre[i] + a[i];
  }
  pair<long, long> ans = {0, 0};
  for (long long i = 0; i < n; i++) {
    long long st = i, en = n - 1, mid;
    while (st <= en) {
      mid = (st + en) / 2;
      long long num = mid - i + 1;
      long long req = (num) * (a[i]) - (pre[mid + 1] - pre[i]);
      if (req <= k) {
        if (num >= ans.first) {
          ans.first = num;
          ans.second = a[i];
        }
        st = mid + 1;
      } else
        en = mid - 1;
    }
  }
  cout << (ans.first) << " " << (ans.second) << "\n";
  return 0;
}
