#include <bits/stdc++.h>
using namespace std;
inline void scan(int& i) { scanf("%d", &i); }
inline void scan(double& i) { scanf("%lf", &i); }
inline void scan(int64_t& i) { scanf("%" PRId64, &i); }
inline void pr(string& s) { cout << s; }
template <typename T, typename V>
inline void scan(pair<T, V>& a) {
  scan(a.first), scan(a.second);
}
inline void pr(int i) { printf("%d", i); }
inline void pr(bool b) { pr((int)b); }
inline void pr(double d) { printf("%.9lf", d); }
inline void prln() { putchar('\n'); }
inline void prsp() { putchar(' '); }
inline void pr(int64_t i) { printf("%" PRId64, i); }
inline void pr(size_t i) { pr((int64_t)i); }
template <typename T>
inline void scan(vector<T>& v) {
  for (T& t : v) scan(t);
}
template <typename T>
inline void scan(T* a, int n) {
  while (n--) scan(*a++);
}
template <class A, class B>
inline void pr(pair<A, B> a) {
  pr(a.first), prsp(), pr(a.second);
}
template <typename T>
inline void prsp(vector<T>& v) {
  for (T& t : v) pr(t), prsp();
}
template <typename T>
inline void prsp(T* a, int n) {
  while (n--) pr(*a++), prsp();
}
template <typename T>
inline void prln(vector<T>& v) {
  for (T& t : v) pr(t), prln();
}
template <typename T>
inline void prln(T* a, int n) {
  while (n--) pr(*a++), prln();
}
template <typename T>
inline void prln(vector<vector<T> >& v) {
  for (vector<T>& t : v) prsp(t), prln();
}
inline void scan(string& s) {
  int c;
  while ((c = getchar()) == '\n' || c == ' ' || c == '\r')
    ;
  do {
    switch (c) {
      case '\n':
      case '\r':
      case ' ':
        return;
      default:
        s += c;
    }
  } while ((c = getchar()) != EOF);
};
template <typename T>
inline void scan(char* s) {
  int c;
  while ((c = getchar())) {
    switch (c) {
      case '\n':
      case '\r':
      case ' ':
        break;
      default:
        *s++ = c;
    }
  }
  *s = 0;
};
template <typename T, typename... Args>
inline void scan(T& first, Args(&... args)) {
  scan(first), scan(args...);
}
template <typename T, typename... Args>
inline void pr(T first, Args... args) {
  pr(first), prsp(), pr(args...);
}
template <typename T>
vector<T>& operator+=(vector<T>& v, T x) {
  v.push_back(x);
  return v;
}
template <typename T>
vector<T>& operator--(vector<T>& v) {
  v.pop_back();
  return v;
}
template <typename T>
vector<T>& operator--(vector<T>& v, int) {
  v.pop_back();
  return v;
}
template <typename T>
bool operator!(stack<T>& q) {
  return !q.empty();
}
template <typename T>
stack<T>& operator+=(stack<T>& v, T x) {
  v.push(x);
  return v;
}
template <typename T>
T operator--(stack<T>& v) {
  v.pop();
  return v.top();
}
template <typename T>
T operator--(stack<T>& v, int) {
  T t = v.top();
  v.pop();
  return t;
}
template <typename T>
bool operator!(queue<T>& q) {
  return !q.empty();
}
template <typename T>
queue<T>& operator+=(queue<T>& v, T x) {
  v.push(x);
  return v;
}
template <typename T>
T operator--(queue<T>& v) {
  v.pop();
  return v.front();
}
template <typename T>
T operator--(queue<T>& v, int) {
  T t = v.front();
  v.pop();
  return t;
}
template <typename T, typename U>
inline void smax(T& a, U b) {
  if (b > a) a = b;
}
template <typename T, typename U>
inline void smin(T& a, U b) {
  if (b < a) a = b;
}
template <typename T, typename U>
inline T gcd(T a, U b) {
  return __gcd(a, b);
}
inline void init();
const int64_t MOD = 1E9 + 7;
const int INF = MOD;
int ex, ac = 0;
int main() {
  init();
  int n, k;
  scan(n, k);
  vector<int> v(n);
  scan(v);
  int64_t a = k;
  sort(v.begin(), v.end());
  int lastv = v[0];
  queue<int> q;
  int tt = 0;
  for (int i : v) {
    a -= 1ll * (i - lastv) * tt;
    lastv = i;
    q.push(i), ++tt;
    while (a < 0) a += i - q.front(), q.pop(), --tt;
    if (tt > ac) ac = tt, ex = i;
  }
  pr(ac, ex);
}
inline void init() {}
