#include <bits/stdc++.h>
using namespace std;
int a[100010];
long long sum[100010];
int main() {
  int n, k;
  cin >> n >> k;
  sum[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    sum[i] += (sum[i - 1] + (long long)a[i]);
  }
  long long maxnum = a[1], countt = 1;
  int beginn = 0;
  for (int i = 2; i <= n; i++) {
    while ((long long)a[i] * (long long)(i - beginn) - (sum[i] - sum[beginn]) >
           (long long)k) {
      beginn++;
    }
    if ((i - beginn) > countt) {
      countt = i - beginn;
      maxnum = (long long)a[i];
    }
  }
  cout << countt << " " << maxnum << endl;
  return 0;
}
