#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n, 0);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<long long> sum(n + 1, 0);
  for (long long i = 1; i <= n; i++) sum[i] += sum[i - 1] + a[i - 1];
  long long l = 0, r = 0;
  long long maxi = 0, mxno = 0;
  while (r < n) {
    long long st = sum[r + 1] - sum[l];
    if (k + st >= (r - l + 1) * a[r]) {
      if (maxi < r - l + 1) {
        maxi = r - l + 1;
        mxno = a[r];
      }
      r++;
    } else {
      l++;
    }
  }
  cout << maxi << " " << mxno << endl;
}
