#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  pair<int, int> maxTimes(vector<int>& a, int N, int K);
};
pair<int, int> Solution::maxTimes(vector<int>& a, int N, int K) {
  sort(a.begin(), a.end());
  vector<long long> sum(N + 1, 0);
  int x = 1, y = 0;
  for (int i = 0; i < N; i++) {
    sum[i + 1] = sum[i] + a[i];
    int _t = x;
    while (_t + 1 <= i + 1 &&
           1LL * a[i] * (_t + 1) - (sum[i + 1] - sum[i + 1 - _t - 1]) <= K)
      _t++;
    if (_t > x) {
      x = _t;
      y = i;
    }
  }
  return pair<int, int>(x, a[y]);
}
int main() {
  int N, K;
  vector<int> a;
  scanf("%d %d", &N, &K);
  for (int i = 0, _x; i < N; i++) {
    scanf("%d", &_x);
    a.push_back(_x);
  }
  class Solution it;
  pair<int, int> tmp = it.maxTimes(a, N, K);
  cout << tmp.first << " " << tmp.second << endl;
  return 0;
}
