#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) { return a < b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
int maxi(int a, int b) { return a > b ? a : b; }
void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int &i : a) {
    cin >> i;
  }
  sort(a.begin(), a.end());
  long long curr = 0, i = 0, j = 0;
  long long ans = 0, ind = a[0];
  while (i < n) {
    while (curr > k) {
      curr -= a[i] - a[j];
      j++;
    }
    if (ans < i - j + 1) {
      ind = a[i];
      ans = i - j + 1;
    }
    i++;
    curr += (i - j) * (a[i] - a[i - 1]);
  }
  cout << ans << " " << ind;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
