#include <bits/stdc++.h>
using namespace std;
long long dir8[2][8] = {{1, -1, 0, 0, 1, -1, 1, -1},
                        {0, 0, 1, -1, 1, -1, -1, 1}};
long long dir4[2][4] = {{1, -1, 0, 0}, {0, 0, 1, -1}};
long long n, row, col, k;
long long ara[100006];
long long sum[100006];
void solve(long long test) {
  scanf("%I64d%I64d", &n, &k);
  for (long long i = 0; i < n; i++) scanf("%I64d", &ara[i]);
  if (n == 1) {
    printf("%I64d %I64d\n", 1ll, ara[0]);
  } else {
    sort(ara, ara + n);
    sum[0] = ara[0];
    for (long long i = 1; i < n; i++) sum[i] = sum[i - 1] + ara[i];
    long long l, r, m, s = 0;
    long long maxFreq = 1;
    long long ans = ara[0];
    if (ara[1] - ara[0] <= k) {
      maxFreq = 2;
      ans = ara[1];
    }
    for (long long i = n - 1; i > 1; i--) {
      l = 0;
      r = i - 1;
      while (l < r) {
        m = (l + r) / 2;
        if (l + 1 == r) {
          if ((i - l) * ara[i] - (sum[i - 1] - (l == 0 ? 0 : sum[l - 1])) <= k)
            m = l;
          else if ((i - r) * ara[i] -
                       (sum[i - 1] - (r == 0 ? 0 : sum[r - 1])) <=
                   k)
            m = r;
          else
            m = i;
          break;
        }
        if ((i - m) * ara[i] - (sum[i - 1] - (m == 0 ? 0 : sum[m - 1])) <= k)
          r = m;
        else
          l = m;
      }
      if (m != i) {
        if (i - m + 1 >= maxFreq) {
          maxFreq = i - m + 1;
          ans = ara[i];
          s = 1;
        }
      }
    }
    printf("%I64d %I64d\n", maxFreq, ans);
  }
}
void test() {
  long long t = 1;
  for (long long test = 1; test <= t; test++) {
    solve(test);
  }
}
int main() {
  test();
  return 0;
}
