#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long s[n];
  s[0] = a[0];
  long long r1 = 1, r2 = a[0];
  long long in = 0;
  for (long long i = 1; i < n; i++) {
    long long b = (i - in) * a[i];
    long long c = s[i - 1];
    if (in != 0) {
      c -= s[in - 1];
    }
    if (b - c <= k) {
      if (i + 1 - in > r1) {
        r1 = i + 1 - in;
        r2 = a[i];
      }
    } else {
      for (int j = in; j < i; j++) {
        ++in;
        c = s[i - 1] - s[j];
        b -= a[i];
        if (b - c <= k) {
          if (i - in > r1) {
            r1 = i - in - 1;
            r2 = a[i];
          }
          break;
        }
      }
    }
    s[i] = a[i] + s[i - 1];
  }
  cout << r1 << ' ' << r2 << endl;
  return 0;
}
