#include <bits/stdc++.h>
using namespace std;
void print(vector<long long> &a) {
  for (long long i : a) {
    cout << i << " ";
  }
  cout << "\n";
}
int main(void) {
  ios_base::sync_with_stdio(false);
  int n;
  long long k;
  cin >> n >> k;
  vector<long long> a(n, 0);
  for (int i = (0); i <= (n - 1); i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<long long> pre(n, 0);
  pre[0] = a[0];
  for (int i = (1); i <= (n - 1); i++) {
    pre[i] = pre[i - 1] + a[i];
  }
  long long m1;
  int m2;
  m1 = a[0];
  m2 = 1;
  for (int i = (1); i <= (n - 1); i++) {
    int lo = 1, hi = i + 1;
    int mid = (lo + hi) / 2;
    while (lo <= hi) {
      long long val;
      if (mid <= i)
        val = a[i] * mid - (pre[i] - pre[i - mid]);
      else
        val = a[i] * mid - (pre[i]);
      if (val <= k) {
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
      mid = (lo + hi) / 2;
    }
    int ans = lo - 1;
    if (ans > m2) {
      m2 = ans;
      m1 = a[i];
    }
  }
  cout << m2 << " " << m1;
  return 0;
}
