#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long n, k;
long long f(long long mid) {
  long long s = 0, maxi = INT_MIN, additions = INT_MAX;
  for (long long i = 0; i < mid; i++) s += a[i];
  additions = mid * a[mid - 1] - s;
  if (additions <= k) return a[mid - 1];
  for (long long i = mid; i < n; i++) {
    s -= a[i - mid];
    s += a[i];
    if (additions > mid * a[i] - s) additions = mid * a[i] - s;
    if (additions <= k) return a[i];
  }
  return INT_MAX;
}
int main() {
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long l = 0, r = n, ans, no;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (f(mid) < INT_MAX) {
      no = f(mid);
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << " " << no << endl;
}
