#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
start:
  while (t--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> v(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    sort(v.rbegin(), v.rend());
    vector<long long> pref(n);
    pref[0] = v[0];
    for (long long i = 1; i < n; i++) {
      pref[i] = pref[i - 1] + (v[i]);
    }
    long long ans = 1, temp = 0, ansval = v[0];
    for (long long i = 0; i < n; i++) {
      long long l = i, r = n - 1;
      while (l <= r) {
        long long mid = (l + r) / 2;
        long long sum, total = (mid - i + 1) * v[i];
        if (i == 0)
          sum = pref[mid];
        else
          sum = pref[mid] - pref[i - 1];
        if (total - sum <= k) {
          if (ans < (mid - i + 1) || (ans == (mid - i + 1) && ansval > v[i])) {
            ans = (mid - i + 1);
            ansval = v[i];
          }
          l = mid + 1;
        } else
          r = mid - 1;
      }
    }
    cout << ans << " " << ansval << endl;
  }
  return 0;
}
