#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int N, K;
long long inp[MAXN + 1];
long long sum[MAXN + 1];
long long getSum(int left, int right) {
  if (left > right) return 0;
  return sum[right] - sum[left - 1];
}
long long getCost(int left, int right) {
  long long size = right - left;
  return size * inp[right] - getSum(left, right - 1);
}
int main() {
  scanf("%d %d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%I64d", &inp[i]);
  sort(inp + 1, inp + N + 1);
  for (int i = 1; i <= N; i++) sum[i] = sum[i - 1] + inp[i];
  int bestTimes = 0;
  int bestNum = 0;
  for (int i = 1; i <= N; i++) {
    int left = 1, right = i;
    int times = 0;
    while (left <= right) {
      int mid = (left + right) / 2;
      long long cost = getCost(mid, i);
      if (cost <= K) {
        times = i - mid + 1;
        right = mid - 1;
      } else
        left = mid + 1;
    }
    if (times > bestTimes) {
      bestTimes = times;
      bestNum = inp[i];
    }
  }
  printf("%d %d\n", bestTimes, bestNum);
  return 0;
}
