#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  std::cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  std::cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int ans = 0;
long long int k;
vector<long long int> inp;
vector<long long int> sums;
long long int calc(long long int n, long long int cnt) {
  long long int f = inp[n - 1] * cnt;
  long long int s = sums[n] - sums[n - cnt];
  return f - s;
}
long long int lbs(long long int n, long long int start, long long int end,
                  long long int key, long long int currentAns) {
  if (end >= start) {
    long long int mid = start + (end - start) / 2;
    if (calc(n, mid) > key) {
      return lbs(n, start, mid - 1, key, currentAns);
    } else {
      return lbs(n, mid + 1, end, key, mid);
    }
  }
  return currentAns;
}
pair<long long int, long long int> solve(long long int n) {
  long long int tmp = lbs(n, 1, n, k, 1);
  return make_pair(tmp, inp[n - 1]);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  long long int n;
  cin >> n >> k;
  sums.push_back(0);
  for (long long int i = 0; i < n; i++) {
    long long int tmp;
    cin >> tmp;
    inp.push_back(tmp);
  };
  sort(inp.begin(), inp.end());
  for (auto& x : inp) {
    sums.push_back(sums[(long long int)sums.size() - 1] + x);
  }
  long long int i = 1;
  long long int maxv = 0;
  long long int maxe = 0;
  while (i <= n) {
    pair<int, int> tmp = solve(i);
    if (tmp.first > maxv) {
      maxv = tmp.first;
      maxe = tmp.second;
    }
    i++;
  }
  cout << maxv << " " << maxe;
  return 0;
}
