#include <bits/stdc++.h>
using namespace std;
long long mx = 0, num, sum[100505], temp;
void maximum(long long ara[], long long n, long long k, int index) {
  long long low = 1, high = index, mid, cnt;
  while (low <= high) {
    mid = (low + high) / 2;
    cnt = index - mid + 1;
    long long cost = (cnt * ara[index]) - (sum[index] - sum[mid - 1]);
    if (cost <= k) {
      if (cnt > mx) {
        mx = cnt;
        num = ara[index];
      }
      high = mid - 1;
    } else
      low = mid + 1;
  }
}
int main() {
  long long n, k, ara[100505];
  scanf("%lld %lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &ara[i]);
  sort(ara + 1, ara + n + 1);
  for (int i = 1; i <= n; i++) sum[i] += ara[i] + sum[i - 1];
  for (int i = 1; i <= n; i++) maximum(ara, n, k, i);
  printf("%lld %lld\n", mx, num);
  return 0;
}
