#include <bits/stdc++.h>
using namespace std;
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int n, m;
int i, j, l, r, t;
long long a[1111111], ans, k, s;
int main() {
  scanf("%d%I64d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  sort(a + 1, a + 1 + n);
  t = 1;
  i = 1;
  ans = a[1];
  for (j = 2; j <= n; j++) {
    while (s + (j - i) * (a[j] - a[j - 1]) > k) s -= a[j - 1] - a[i++];
    s += (j - i) * (a[j] - a[j - 1]);
    if (j - i + 1 > t) {
      t = j - i + 1;
      ans = a[j];
    }
  }
  printf("%d %I64d\n", t, ans);
  return 0;
}
