#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline string tostr(const T& a) {
  ostringstream x("");
  x << a;
  return x.str();
}
const int inf = 1999999999;
const double pi = acos(-1.0);
const double eps = 1e-9;
long long a[100010];
long long psum[100010];
int main() {
  clock_t _ = clock();
  cout << fixed << setprecision(15);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  psum[0] = a[0];
  for (int i = 1; i < n; i++) {
    psum[i] = psum[i - 1] + a[i];
  }
  long long ans = a[0];
  int best = 0;
  for (int i = 0; i < n; i++) {
    int left = 0, right = i;
    while (left < right) {
      int mid = (left + right) / 2;
      long long rhs = a[i] * (i - mid + 1);
      long long lhs = psum[i] - (mid > 0 ? psum[mid - 1] : 0);
      if (rhs - lhs <= k)
        right = mid;
      else
        left = mid + 1;
    }
    int tmp = i - right + 1;
    if (tmp > best) {
      best = tmp;
      ans = a[i];
    }
  }
  cout << best << " " << ans;
  return 0;
}
