#include <bits/stdc++.h>
using namespace std;
const string sep = " ";
int main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<int> A(n);
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  int it = 0;
  vector<long long> R(n);
  R[0] = 1;
  long long used = 0;
  for (int i = 1; i < n; ++i) {
    R[i] = R[i - 1] + 1;
    used += (A[i] - A[i - 1]) * (R[i - 1]);
    while (used > k) {
      used -= A[i] - A[it];
      ++it;
      --R[i];
    }
  }
  int result = R[0];
  int _i = 0;
  for (int i = 1; i < n; ++i) {
    if (R[i] > result) {
      result = R[i];
      _i = i;
    }
  }
  cout << result << " " << A[_i];
}
