#include <bits/stdc++.h>
using namespace std;
long long int a[100005], sum[100005];
long long int n, k;
int binary_search(int index) {
  long long int lo = 0, hi = index, ans = 0;
  while (lo <= hi) {
    long long int mid = (hi + lo) / 2;
    if ((mid * a[index]) - (sum[index - 1] - sum[index - 1 - mid]) <= k) {
      ans = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  return ans;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    sum[i] = sum[i - 1] + a[i];
  }
  long long int ans1 = 0, ans2 = a[0];
  for (int i = n - 1; i >= 0; i--) {
    int freq = binary_search(i);
    if (freq >= ans1) {
      ans1 = freq;
      ans2 = a[i];
    }
  }
  cout << ans1 + 1 << " " << ans2 << endl;
  return 0;
}
