#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long long int> a;
  long long int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  long long int j = 0, m = 0, number;
  long long int c = 0;
  for (int i = 1; i < n; i++) {
    c += 1LL * (a[i] - a[i - 1]) * (i - j);
    while (j < n && c > k) {
      c -= a[i] - a[j];
      j++;
    }
    if (m < (i - j) + 1 || j == n) {
      number = a[i];
      m = i - j + 1;
    }
  }
  if (m == 0)
    cout << 1 << " " << a[0];
  else
    cout << m << " " << number;
}
