#include <bits/stdc++.h>
using namespace std;
int a[100007];
long long sum[100007];
int bSearch(int l, int r, int k, int pos) {
  int ans = 1;
  while (l <= r) {
    int m = (l + r) >> 1;
    long long tmp = (long long)m * a[pos] - (sum[pos] - sum[pos - m]);
    if (tmp <= k) {
      l = m + 1;
      ans = m;
    } else {
      r = m - 1;
    }
  }
  return ans;
}
int main() {
  int i;
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    sum[0] = 0;
    for (i = 1; i <= n; ++i) scanf("%d", &a[i]);
    sort(a + 1, a + 1 + n);
    for (i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
    int ans = 1;
    int mk = a[1];
    int tmp;
    for (i = 2; i <= n; ++i) {
      tmp = bSearch(1, i, k, i);
      if (ans < tmp) {
        ans = tmp;
        mk = a[i];
      }
    }
    printf("%d %d\n", ans, mk);
  }
  return 0;
}
