#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long a[200005] = {};
long long dp[100005] = {};
long long ans = 0, val = 0;
void bs(int i, long long k) {
  long long x = a[i];
  long long l = 0, r = i;
  long long temp = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    long long req = (i - mid) * x - dp[i] + dp[mid];
    if (req <= k) {
      r = mid - 1;
      temp = max(temp, i - mid);
    } else {
      l = mid + 1;
    }
  }
  if (temp >= ans) {
    ans = temp;
    val = a[i];
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  long long n, 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++) dp[i] = a[i] + dp[i - 1];
  for (int i = n; i >= 1; i--) {
    bs(i, k);
  }
  cout << ans << " " << val;
}
