#include <bits/stdc++.h>
using namespace std;
int n, k, maxx, cmax;
int t[100010];
long long int sum[100010];
int binary_search1(int st, int dr, int pos, int x) {
  int sol = 0;
  while (st <= dr) {
    int m = (st + dr) / 2;
    long long int lsum = sum[pos] - sum[m - 1];
    lsum = 1LL * (pos - m + 1) * x - lsum;
    if (lsum <= k) {
      sol = m;
      dr = m - 1;
    } else
      st = m + 1;
  }
  return sol;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &t[i]);
  sort(t + 1, t + n + 1);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + t[i];
  maxx = 1;
  cmax = t[1];
  for (int i = 1; i <= n; i++) {
    int pos = binary_search1(1, i - 1, i, t[i]);
    if (pos > 0 && i - pos + 1 > maxx) {
      maxx = i - pos + 1;
      cmax = t[i];
    }
  }
  printf("%d %d", maxx, cmax);
  return 0;
}
