#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  long long int a[n + 2];
  vector<long long int> pre(n + 2);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i];
  }
  int left = 1;
  int num = -1, occur = -1;
  for (int i = 1; i <= n; i++) {
    while ((a[i] * (i - left + 1) - (pre[i] - pre[left - 1])) > k) left++;
    if (occur < (i - left + 1)) {
      occur = i - left + 1;
      num = a[i];
    }
  }
  cout << occur << " " << num << endl;
}
