#include <bits/stdc++.h>
using namespace std;
long long n, k, ar[100001];
long long pr[100001];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  sort(ar + 1, ar + n + 1);
  for (int i = 1; i <= n; i++) {
    pr[i] = pr[i - 1] + ar[i];
  }
  long long ans2 = ar[1], ma = 1;
  for (int i = 2; i <= n; i++) {
    int lo = 1, hi = i;
    int mid = -1;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      long long sum = pr[i] - pr[mid - 1];
      long long req = (i - mid + 1) * ar[i];
      if (req - sum <= k) {
        hi = mid;
      } else {
        lo = mid + 1;
      }
    }
    if (ma < i - lo + 1) {
      ma = i - lo + 1;
      ans2 = ar[i];
    }
  }
  cout << ma << " " << ans2;
}
