#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e5;
long long n, k, a[mxn], b[mxn];
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a, a + n);
  b[0] = a[0];
  for (int i = 1; i < n; i++) {
    b[i] = a[i] + b[i - 1];
  }
  pair<int, int> ans = {1, a[0]};
  for (int i = 1; i < n; i++) {
    int l = 1, r = i;
    while (l <= r) {
      int m = l + (r - l) / 2;
      long long cost = b[i - 1];
      if (i - m > 0) cost -= b[i - m - 1];
      cost = a[i] * m - cost;
      if (cost > k) {
        r = m - 1;
      } else {
        if (m + 1 > ans.first) {
          ans = make_pair(m + 1, a[i]);
          break;
        }
        l = m + 1;
      }
    }
  }
  printf("%d %d\n", ans.first, ans.second);
  return 0;
}
