#include <bits/stdc++.h>
using namespace std;
const int N = 102000;
int a[N];
long long s[N] = {0};
int n, k;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = 0; i < n; ++i)
    if (i > 0)
      s[i] = s[i - 1] + (long long)a[i];
    else
      s[i] = (long long)a[i];
  int j;
  int maxK = 0, maxI;
  for (int i = 0; i < n; ++i) {
    j = i - maxK;
    while (j >= 0) {
      long long sum = s[i] + k;
      if (j > 0) sum -= s[j - 1];
      if (sum >= (long long)(i - j + 1) * (long long)a[i] && i - j + 1 > maxK) {
        maxK = i - j + 1;
        maxI = a[i];
      } else
        break;
      j--;
    }
  }
  printf("%d %d\n", maxK, maxI);
  return 0;
}
