#include <bits/stdc++.h>
template <class T>
inline T gcd(T x, T y) {
  if (!y) return x;
  return gcd(y, x % y);
}
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
long long a[MAX];
int main(int argc, char* argv[]) {
  if (argc == 2 or argc == 3) freopen(argv[1], "r", stdin);
  if (argc == 3) freopen(argv[2], "w", stdout);
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  long long x1 = k;
  int y1 = 0, ans2 = 1, ans3 = a[0];
  for (int i = 1; i < n; ++i) {
    if ((a[i] - a[i - 1]) * (i - y1) <= x1)
      x1 -= (a[i] - a[i - 1]) * (i - y1);
    else {
      while ((a[i] - a[i - 1]) * (i - y1) > x1) {
        x1 += (a[i - 1] - a[y1]);
        y1++;
      }
      x1 -= (a[i] - a[i - 1]) * (i - y1);
    }
    if (i - y1 + 1 > ans2) ans2 = (i - y1) + 1, ans3 = a[i];
  }
  cout << ans2 << ' ' << ans3 << endl;
  return 0;
}
