#include <bits/stdc++.h>
using namespace std;
long long sp[100005];
int n, k, sir[100005];
int check(int nr) {
  for (int i = nr; i <= n; ++i) {
    long long sum = sp[i] - sp[i - nr];
    if (nr * 1LL * sir[i] - sum <= k) {
      return sir[i];
    }
  }
  return (1 << 30);
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> sir[i];
  }
  sort(sir + 1, sir + n + 1);
  for (int i = 1; i <= n; ++i) sp[i] = sp[i - 1] + sir[i];
  int ls = 1, ld = n, rez = 0;
  for (; ls <= ld;) {
    int m = (ls + ld) / 2;
    if (check(m) != (1 << 30)) {
      rez = m;
      ls = m + 1;
    } else
      ld = m - 1;
  }
  cout << rez << ' ' << check(rez);
  return 0;
}
