#include <bits/stdc++.h>
using namespace std;
long long int n, k;
long long int minans;
long long int a[1000000];
long long int is_poss_count(long long int cnt) {
  if (cnt > n) {
    return -INT_MAX;
  }
  int r = n - 1;
  int l = r - cnt + 1;
  long long int cur = 0;
  for (int i = l; i <= r; i++) {
    cur += a[i];
  }
  int pos = n - 1;
  int ans = -INT_MAX;
  while (l >= 0) {
    long long int val = a[pos] * cnt;
    if (val <= cur + k) {
      ans = a[pos];
    }
    pos--;
    cur -= a[r];
    r--;
    l--;
    if (l >= 0) {
      cur += a[l];
    }
  }
  return ans;
}
int main() {
  long long int i, j, ct = 0, m, t, x, y, z, l, r;
  cin >> n >> k;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  l = 1;
  r = n;
  long long int ans = 0;
  long long int ansn;
  while (l < r) {
    int mid = (l + r) / 2;
    x = is_poss_count(mid);
    if (x != -INT_MAX && mid > ans) {
      ans = mid;
      ansn = x;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  x = is_poss_count(l);
  if (x != -INT_MAX && l > ans) {
    ans = l;
    ansn = x;
  }
  cout << ans << " " << ansn;
  return 0;
}
