#include <bits/stdc++.h>
using namespace std;
long long sum[100011] = {0};
long long calc(int p, int p2) {
  long long a;
  if (p == 0)
    a = 0;
  else
    a = sum[p - 1];
  return sum[p2] - a;
}
int main() {
  int n;
  while (cin >> n) {
    int k;
    cin >> k;
    int num[100111] = {0};
    for (int i = 0; i < n; i++) {
      cin >> num[i];
    }
    sort(num, num + n);
    for (int i = 0; i < n; i++)
      sum[i] = (i == 0 ? num[i] : num[i] + sum[i - 1]);
    int maxt = 1, maxn = num[0];
    for (int i = 1; i < n; i++) {
      int l = 0, r = i;
      while (l < r - 1) {
        int m = l + r >> 1;
        if (calc(m, i) + k < (long long)num[i] * (i - m + 1))
          l = m;
        else
          r = m;
      }
      int res = 0;
      if (calc(l, i) + k < (long long)num[i] * (i - l + 1))
        res = r;
      else
        res = l;
      if (i - res + 1 > maxt) maxt = i - res + 1, maxn = num[i];
    }
    printf("%d %d", maxt, maxn);
  }
  return 0;
}
