#include <bits/stdc++.h>
using namespace std;
long long i, j, n, m, a[110000], k, num, ans, p;
long long s[110000];
long long search(long long l, long long r, long long j) {
  long long c;
  if (l == r) return l;
  if (l == r - 1) {
    if ((j - l) * a[j] <= s[j - 1] - s[l - 1] + k) return l;
    return r;
  }
  c = (l + r) / 2;
  if ((j - c) * a[j] <= s[j - 1] - s[c - 1] + k)
    return search(l, c, j);
  else
    return search(c, r, j);
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  if (n == 1 && k == 0 && a[1] == 0) {
    cout << 1 << " " << 0 << endl;
    return 0;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) s[i] = s[i - 1] + a[i];
  for (i = 1; i <= n; i++) {
    while (a[i] == a[i + 1]) i++;
    long long k = search(1, i, i);
    long long p = i - k + 1;
    if (ans < p) {
      ans = p;
      num = a[i];
    }
  }
  cout << ans << " " << num << endl;
}
