#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> a[100001];
long long s, n, k, ans, ans1;
bool check(long long x) {
  for (long long i = x; i <= n; i++) {
    s = x * a[i].first - a[i].second + a[i - x].second;
    if (k >= s) {
      ans = a[i].first;
      ans1 = x;
      return true;
    }
  }
  return false;
}
int main() {
  long long f, e, m, s1 = 0;
  cin >> n >> k;
  f = 1, e = n;
  for (long long i = 1; i <= n; i++) cin >> a[i].first;
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) s1 += a[i].first, a[i].second = s1;
  while (f <= e) {
    m = f + (e - f) / 2;
    if (check(m))
      f = m + 1;
    else
      e = m - 1;
  }
  cout << ans1 << " " << ans;
  return 0;
}
