#include <bits/stdc++.h>
using namespace std;
long long a[100010];
long long sum[100010];
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  long long b = 0;
  long long ans = a[1], times = 1;
  for (int i = 2; i <= n; i++) {
    while ((i - b) * a[i] - (sum[i] - sum[b]) > k) b++;
    if (i - b > times) {
      times = i - b;
      ans = a[i];
    }
  }
  cout << times << " " << ans << endl;
}
