#include <bits/stdc++.h>
using namespace std;
long long a[100005], n, k, cums[100005];
long long F(long long times) {
  long long j, s, need, ans = -1;
  for (long long i = n; i - times + 1 >= 1; i--) {
    j = i - times + 1;
    s = cums[i] - cums[j - 1];
    need = times * a[i];
    if (need - s <= k) {
      ans = a[i];
    }
  }
  return ans;
}
int main() {
  scanf("%lld", &n), scanf("%lld", &k);
  for (long long i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; ++i) cums[i] = cums[i - 1] + a[i];
  long long lw = 1, hi = n, ans = 1, val = a[1], mid, tmp;
  while (lw <= hi) {
    mid = (lw + hi) / 2;
    tmp = F(mid);
    if (tmp == -1) {
      hi = mid - 1;
    } else {
      ans = mid;
      val = tmp;
      lw = mid + 1;
    }
  }
  printf("%lld %lld\n", ans, val);
  return 0;
}
