#include <bits/stdc++.h>
using namespace std;
long long n, k, a[3000003], sum[3000003], ans;
bool check(long long x) {
  for (long long i = x - 1; i < n; i++) {
    if (a[i] * x - (sum[i] - sum[i - x]) <= k) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (long long i = 0; i < n; i++) sum[i] = sum[i - 1] + a[i];
  long long r = n;
  long long l = 1;
  long long q = 10;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  cout << ans << " ";
  for (long long i = ans - 1; i < n; i++) {
    if (a[i] * ans - (sum[i] - sum[i - ans]) <= k) {
      cout << a[i];
      break;
    }
  }
  cout << endl;
}
