#include <bits/stdc++.h>
using namespace std;
void doit() {
  int n, k;
  cin >> n >> k;
  long long int a[n + 1];
  long long int pre[n + 1];
  pre[0] = 0;
  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];
  long long ans = 0, freq = 0;
  for (int i = 1; i <= n; i++) {
    int l = 1, h = i;
    int mid;
    while (l <= h) {
      mid = (l + h) / 2;
      if (a[i] * (i - mid + 1) - (pre[i] - pre[mid - 1]) <= k) {
        h = mid - 1;
        if (i - mid + 1 > freq) {
          ans = a[i];
          freq = i - mid + 1;
        }
      } else
        l = mid + 1;
    }
  }
  cout << freq << " " << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  doit();
}
