#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
using uLL = unsigned long long int;
using uint = unsigned int;
using ld = long double;
const int N = 100007;
int tab[N];
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(0);
  int n;
  LL k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
  }
  sort(tab, tab + n);
  LL cost = 0;
  LL odp = 1;
  LL ans = tab[0];
  int l = 0;
  int x = tab[0];
  for (int i = 1; i < n; i++) {
    while (LL(tab[i] - x) * (i - l) + cost > k) {
      cost -= x - tab[l];
      l++;
    }
    cost += LL(i - l) * (tab[i] - x);
    if (i - l + 1 > odp) {
      odp = i - l + 1;
      ans = tab[i];
    }
    x = tab[i];
  }
  cout << odp << " " << ans << '\n';
  return 0;
}
