#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long val[maxn];
long long sum[maxn];
long long ans;
int cnt;
long long n, k;
int check(int len) {
  for (int i = len; i <= n; i++) {
    if (sum[i] - sum[i - len] + k >= val[i] * len) {
      if (len > cnt) cnt = len, ans = val[i];
      if (len == cnt && val[i] < ans) ans = val[i];
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%lld %lld", &n, &k);
  sum[0] = 0;
  for (int i = 1; i <= n; i++) scanf("%lld", &val[i]);
  sort(val + 1, val + n + 1);
  for (int i = 1; i <= n; i++) sum[i] = val[i] + sum[i - 1];
  int l = 1, r = n, mid;
  while (l <= r) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d %lld\n", cnt, ans);
  return 0;
}
