#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
const long long N = 1e6 + 10;
const long long IM = 1e18;
const long long PI = 3.14159265;
void PV(vector<long long> v) {
  for (long long i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
void PA(long long v[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cout << v[i] << " ";
  cout << "\n";
}
void IN(long long a[], long long n, long long x = 0) {
  for (long long i = x; i < n + x; i++) cin >> a[i];
}
inline void PTN(long long n = 1, long long a = 0, long long b = 0,
                long long c = 0) {
  if (n--) cout << a << " ";
  if (n--) cout << b << " ";
  if (n--) cout << c << " ";
  cout << "\n";
}
inline void op() {}
long long a[N] = {}, b[N], c[N];
long long n, k;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  op();
  long long i, j, x, y, u, l;
  long long tt = 1;
  {
    i = j = x = y = u = l = 0;
    cin >> n >> k;
    IN(a, n);
    sort(a, a + n);
    for (i = n - 2; i >= 0; i--) {
      b[i] = a[i + 1] - a[i];
    }
    for (i = n - 2; i >= 0; i--) b[i] += b[i + 1];
    long long ans1, ans2;
    ans1 = 0;
    ans2 = 0;
    for (i = n - 1; i >= 0; i--) c[i] += c[i + 1] + b[i];
    for (i = 0; i < n; i++) {
      x = 0;
      y = i;
      l = i;
      while (x <= y) {
        u = x + (y - u) / 2;
        long long uu = i - u;
        uu = uu * b[i];
        if (c[u] <= uu + c[i] + k) {
          l = u;
          y = u - 1;
        } else
          x = u + 1;
      }
      l = i - l + 1;
      if (l > ans1) {
        ans1 = l;
        ans2 = a[i];
      }
    }
    cout << ans1 << " " << ans2 << "\n";
  }
  return 0;
}
