#include <bits/stdc++.h>
using namespace std;
template <class T>
inline std::string to_string(const T& t) {
  std::stringstream ss;
  ss << t;
  return ss.str();
}
long long n, k, ar[100005], s[100005];
int main() {
  cin >> n >> k;
  int i, j;
  for (i = 1; i < n + 1; i += 1) {
    cin >> ar[i];
  }
  sort(ar + 1, ar + n + 1);
  for (i = 1; i < n + 1; i += 1) {
    s[i] = s[i - 1] + ar[i];
  }
  long long ans = 1, ansv = ar[1];
  for (i = 2; i < n + 1; i += 1) {
    long long lo = 0, hi = i - 1, mid;
    while (lo < hi) {
      mid = (lo + hi + 1) / 2;
      long long need = ar[i] * mid;
      if ((need - (s[i - 1] - s[i - mid - 1])) <= k) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    if (ans < (lo + 1)) {
      ans = lo + 1, ansv = ar[i];
    }
  }
  cout << ans << " " << ansv;
}
