#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000 + 1;
long long num[MAX] = {0};
long long sum[MAX] = {0};
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> num[i];
  sort(num + 1, num + n + 1);
  for (long long i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + num[i];
  }
  long long cnt = 0, ans;
  long long pos = 0;
  for (long long i = 1; i <= n; i++) {
    while (i > pos && (num[i] * (i - pos) - (sum[i] - sum[pos]) > k)) pos++;
    if (i - pos > cnt) {
      cnt = i - pos;
      ans = num[i];
    }
  }
  cout << cnt << " " << ans << endl;
  return 0;
}
