#include <bits/stdc++.h>
const int mx = 1e6 + 5;
const int inf = 0x3f3f3f3f;
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  scanf("%d%d", &n, &k);
  vector<long long int> v(n);
  for (int i = 0; i < n; ++i) scanf("%lld", &v[i]);
  sort(v.begin(), v.end());
  long long int l = 0, r = 1, qt = 0, vi = 0;
  long long int diff = 0;
  while (l < n) {
    while (r < n && diff <= k) {
      if (diff + ((r - l) * (v[r] - v[r - 1])) > k) break;
      diff += (r - l) * (v[r] - v[r - 1]);
      ++r;
    }
    if (diff <= k) {
      if (qt < r - l) {
        qt = r - l;
        vi = v[r - 1];
      }
    }
    diff -= v[r - 1] - v[l];
    ++l;
  }
  printf("%lld %lld\n", qt, vi);
  return 0;
}
