#include <bits/stdc++.h>
long long b[100000 + 10];
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
int main() {
  long long n, kk, i, j;
  long long k, sum;
  bool flag;
  while (scanf("%I64d %I64d", &n, &k) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%I64d", &b[i]);
    }
    qsort(b, n, sizeof(b[0]), cmp);
    long long max = 0, max_i;
    int start = 0;
    for (i = 0; i < n; i++) {
      if (i) k -= (b[i] - b[i - 1]) * (i - start);
      while (k > 0 && start > 0) {
        start--;
        k -= b[i] - b[start];
      }
      while (k < 0) {
        k += b[i] - b[start];
        start++;
      }
      if (i - start + 1 > max) {
        max = i - start + 1;
        max_i = i;
      }
    }
    printf("%I64d %I64d\n", max, b[max_i]);
  }
  return 0;
}
