#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int prev = arr[0], best = -1, num, left = 0;
  for (int i = 0; i < n; i++) {
    k -= (0LL + i - left) * (arr[i] - prev);
    while (k < 0) {
      k += arr[i] - arr[left++];
    }
    if (best < i - left + 1) {
      best = i - left + 1;
      num = arr[i];
    }
    prev = arr[i];
  }
  cout << best << " " << num << endl;
  return 0;
}
