#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
long long const inf = 1e18, linf = 2e9, mod = 1e9 + 7, inf2 = 1e12;
int const mxn = 1e6 + 10;
long long poww(long long a, long long b, long long md) {
  return (!b ? 1
             : (b & 1 ? a * poww(a * a % md, b / 2, md) % md
                      : poww(a * a % md, b / 2, md) % md));
}
long long n, k, a[mxn], ans;
bool check(long long x) {
  long long sum = 0;
  for (int i = 1; i <= x; i++) sum += a[i];
  if (a[x] * x - sum <= k) {
    ans = a[x];
    return 1;
  }
  for (int i = x + 1; i <= n; i++) {
    sum -= a[i - x];
    sum += a[i];
    if (a[i] * x - sum <= k) {
      ans = a[i];
      return 1;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  int l = 0, r = n + 1, mid;
  while (r - l > 1) {
    mid = (r + l) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  cout << l << " " << ans;
}
