#include <bits/stdc++.h>
using namespace std;
template <typename item>
item abs(item i) {
  if (i < 0) i = -i;
  return i;
}
template <class type>
type POW(type b, type p) {
  type res = 1;
  while (p) {
    if (p & 1) res *= b;
    b *= b;
    b %= 1000000007LL;
    res %= 1000000007LL;
    p /= 2;
  }
  return res;
}
int tc = 0;
long long int arr[100010], presum[100010];
long long int n;
long long int k;
long long int binary(long long int n, long long int mul) {
  long long int ans = 1;
  long long int low = 1, high = n;
  while (low <= high) {
    long long int mid = (low + high) / 2;
    long long int r = (n - mid + 1) * mul;
    r = r - (presum[n] - presum[mid - 1]);
    if (r <= k) {
      ans = n - mid + 1;
      high = mid - 1;
    } else
      low = mid + 1;
  }
  return ans;
}
int main() {
  cin >> n;
  cin >> k;
  for (long long int i = 1; i <= n; i++) cin >> arr[i];
  sort(arr + 1, arr + n + 1);
  for (long long int i = 1; i <= n; i++) presum[i] = arr[i] + presum[i - 1];
  long long int ans = 0, val = -1;
  for (long long int i = 1; i <= n; i++) {
    long long int r = binary(i, arr[i]);
    if (r > ans) ans = r, val = arr[i];
  }
  cout << ans << " " << val;
}
