#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char ch = getchar();
  long long fh = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x *= fh;
}
template <typename T>
void write(T x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
void writeln(T x) {
  write(x);
  puts("");
}
long long n, k;
long long a[100005];
long long s[100005];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) s[i] = s[i - 1] + a[i];
  long long mx = 0, ans;
  for (long long i = 1; i <= n; i++) {
    long long l = 1, r = i - 1;
    while (l < r) {
      long long mid = l + r >> 1;
      long long val = (i - mid) * a[i] - (s[i - 1] - s[mid - 1]);
      if (val <= k)
        r = mid;
      else
        l = mid + 1;
    }
    if (i - l + 1 > mx) {
      mx = i - l + 1;
      ans = a[i];
    }
  }
  cout << mx << ' ' << ans << endl;
  return 0;
}
