#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
long long a[100002], sum[100002];
int main() {
  ios_base::sync_with_stdio(0);
  int ans = -1, mmin, n;
  long long k;
  cin >> n >> k;
  for (int(i) = 1; (i) <= (n); (i)++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int(i) = 1; (i) <= (n); (i)++) sum[i] = sum[i - 1] + a[i];
  int j = 1;
  for (int(i) = 1; (i) <= (n); (i)++) {
    while (a[i] * (i - j + 1) - sum[i] + sum[j - 1] > k) j++;
    if (i - j + 1 > ans) {
      ans = i - j + 1;
      mmin = a[i];
    }
  }
  cout << ans << " " << mmin << endl;
}
