#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int i = 0, j = 0;
  long long int a[n];
  for (auto &x : a) cin >> x;
  sort(a, a + n);
  long long int level = a[0], pre = a[0];
  long long int mx = 1, ans = a[0];
  long long int sum = 0;
  for (int j = 1; j < n; j++) {
    level = a[j];
    sum += (j - i) * (level - pre);
    while (sum > k) {
      sum -= (level - a[i]);
      i++;
    }
    if (mx < (j - i + 1)) {
      mx = j - i + 1;
      ans = a[j];
    }
    pre = a[j];
  }
  cout << mx << " " << ans << "\n";
  return 0;
}
