#include <bits/stdc++.h>
using namespace std;
long long n, k, a[1000100];
int main() {
  while (cin >> n >> k) {
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    long long cnt = 0, j = 1, maxx = 0, ans = 1, mn = a[1];
    for (int i = 2; i <= n; i++) {
      cnt += (i - j) * (a[i] - a[i - 1]);
      while (cnt > k) {
        cnt -= (a[i] - a[j]);
        j++;
      }
      if (i - j + 1 > ans) {
        ans = i - j + 1;
        mn = a[i];
      }
    }
    cout << ans << " " << mn << endl;
  }
  return 0;
}
