#include <bits/stdc++.h>
using namespace std;
const int N = 100 * 1000 + 10;
int a[N];
int main() {
  int max = 0, maxa;
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int j = n - 2;
  for (int i = n - 1; i >= 0; i--) {
    while (a[i] - a[j] <= k && j >= 0) {
      k -= a[i] - a[j];
      j--;
    }
    if (max <= i - j) {
      max = i - j;
      maxa = a[i];
    }
    k += (a[i] - a[i - 1]) * (i - j - 1);
  }
  cout << max << ' ' << maxa << endl;
  return 0;
}
