#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  long long ar[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  long long pre[n];
  pre[0] = ar[0];
  for (int i = 1; i < n; i++) pre[i] = pre[i - 1] + ar[i];
  long long ans = 1, num = ar[0];
  for (int i = 0; i < n; i++) {
    long long lo = 0, hi = i - 1;
    long long tempLongest = 1, cur = ar[i];
    while (lo <= hi) {
      long long mid = (lo + hi) / 2;
      long long distFromI = i - mid;
      long long intervalSum;
      if (mid == 0)
        intervalSum = pre[i - 1];
      else
        intervalSum = pre[i - 1] - pre[mid - 1];
      long long toRaise = distFromI * ar[i] - intervalSum;
      if (toRaise > k) {
        lo = mid + 1;
      } else {
        if (distFromI + 1 > tempLongest) tempLongest = distFromI + 1;
        hi = mid - 1;
      }
    }
    if (tempLongest > ans)
      ans = tempLongest, num = ar[i];
    else if (tempLongest == ans)
      num = min(num, ar[i]);
  }
  cout << ans << " " << num;
}
