#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long k, suffix[n + 1], a[n];
  cin >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  suffix[n] = 0;
  for (int i = n - 1; i >= 0; i--) suffix[i] = suffix[i + 1] + a[i];
  int occur_max = 1, best = a[0];
  for (int i = 1; i < n; i++) {
    int low = 0, high = i;
    while ((high - low) > 1) {
      int mid = (low + high) / 2;
      long long exp = ((a[i] * (i - mid + 1)) - (suffix[mid] - suffix[i + 1]));
      if (exp <= k)
        high = mid;
      else
        low = mid + 1;
    }
    if ((a[i] * (i - low + 1) - (suffix[low] - suffix[i + 1])) <= k and
        (i - low + 1) > occur_max) {
      occur_max = i - low + 1;
      best = a[i];
    }
    low = high;
    if ((a[i] * (i - low + 1) - (suffix[low] - suffix[i + 1])) <= k and
        (i - low + 1) > occur_max) {
      occur_max = i - low + 1;
      best = a[i];
    }
  }
  cout << occur_max << " " << best;
  return 0;
}
