#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, k, i, j, l, r, ans, anss, sm, m, p;
  cin >> n >> k;
  long long a[n + 1], cm[n + 1];
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  cm[0] = 0;
  for (i = 1; i <= n; i++) cm[i] = cm[i - 1] + a[i];
  ans = 1, anss = a[1];
  for (i = 2; i <= n; i++) {
    l = 1, r = i - 1, p = i;
    while (l <= r) {
      m = (l + r) / 2;
      sm = cm[i - 1] - cm[m - 1];
      if (a[i] * (i - m) - sm <= k)
        p = m, r = m - 1;
      else
        l = m + 1;
    }
    if (i - p + 1 > ans) ans = i - p + 1, anss = a[i];
  }
  cout << ans << " " << anss << endl;
}
