#include <bits/stdc++.h>
using namespace std;
string vow = "aeiou";
const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};
const int dx[] = {-1, 0, 0, 1};
const int dy[] = {0, -1, 1, 0};
const long double pie = 3.14159265358979;
const long long mod = 1e9 + 7;
void solve(int test_case) {
  int n, k;
  cin >> n >> k;
  vector<long long> v(n + 1);
  for (int i = 1; i < n + 1; i++) cin >> v[i];
  v[0] = LLONG_MIN;
  sort((v).begin(), (v).end());
  v[0] = 0;
  vector<long long> pref(n + 1);
  for (int i = 1; i < n + 1; i++) pref[i] = pref[i - 1] + v[i];
  int ans = 0;
  int can = v[1];
  for (int i = 1; i < n + 1; i++) {
    long long val = v[i];
    int r = i - 1;
    for (int lo = 1, hi = i - 1; lo <= hi;) {
      int mid = lo + hi >> 1;
      int len = i - 1 - mid + 1;
      int l = mid;
      long long d = pref[r] - pref[l - 1];
      d = val * len - d;
      if (d <= k) {
        if (len > ans) {
          ans = len;
          can = val;
        }
        hi = mid - 1;
      } else
        lo = mid + 1;
    }
  }
  ans++;
  cout << ans << " " << can;
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 0; i < t; i++) solve(i);
  return 0;
}
