#include <bits/stdc++.h>
const double EPS = 1e-9;
const int INT_INF = 0x7FFFFFFF;
const long long I64_INF = 0x7FFFFFFFFFFFFFFF;
const double PI = acos(-1.0);
using namespace std;
int n, k;
int a[100500];
long long sum[100500];
long long getsum(int l, int r) { return sum[r + 1] - sum[l]; }
bool can(int l, int r, int val) {
  return 1LL * val * (r - l + 1) - getsum(l, r) <= 1LL * k;
}
int main() {
  cin >> n >> k;
  sum[0] = 0;
  for (int i = 0; i < (int)n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = 0; i < (int)n; i++) sum[i + 1] = sum[i] + 1LL * a[i];
  int ma = 1;
  int id = 0;
  for (int i = 1; i < (int)n; i++) {
    int L = 0;
    int R = i;
    while (L != R - 1) {
      int M = (L + R) / 2;
      if (can(M, i - 1, a[i]))
        R = M;
      else
        L = M;
    }
    if (!can(L, i - 1, a[i])) L++;
    if (i - L + 1 > ma) {
      ma = i - L + 1;
      id = i;
    } else if (i - L + 1 == ma && a[i] < a[id])
      id = i;
  }
  printf("%d %d\n", ma, a[id]);
  return 0;
}
