#include <bits/stdc++.h>
using namespace std;
long long n, k, a[1020304];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) scanf("%I64d", &a[i]);
  sort(a + 1, a + n + 1);
  long long p = 1;
  long long now = 0;
  long long ans = 0, ans2;
  for (int i = 1; i <= n; ++i) {
    while (now > k) {
      now -= a[i] - a[p];
      ++p;
    }
    if (i - p + 1 > ans) ans = i - p + 1, ans2 = a[i];
    now += (a[i + 1] - a[i]) * (i - p + 1);
  }
  cout << ans << ' ' << ans2 << endl;
  return 0;
}
