#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long subsum[100005];
int main() {
  long long n, k;
  cin >> n >> k;
  long long i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  subsum[0] = 0;
  for (i = 0; i < n; i++) {
    subsum[i + 1] = subsum[i] + a[i];
  }
  long long j, maxoc = 0, minnum = a[0];
  long long count;
  for (i = 1; i < n; i++) {
    for (j = maxoc + 1; j < i + 1; j++) {
      count = j * a[i] - subsum[i] + subsum[i - j];
      if (count <= k) {
        minnum = a[i];
        maxoc = j;
      } else
        break;
    }
  }
  cout << maxoc + 1 << " " << minnum << endl;
  return 0;
}
