#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed;
  cout.precision(10);
  int n, k;
  cin >> n >> k;
  long long arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  pair<long long, long long> sol;
  sol.first = 1;
  sol.second = arr[0];
  long long prev = 0;
  int j = 0;
  for (int i = 1; i < n; i++) {
    prev += (i - j - 1) * (arr[i] - arr[i - 1]);
    prev += arr[i] - arr[i - 1];
    while (prev > k and j < i) {
      prev -= (arr[i] - arr[j++]);
    }
    if (i - j + 1 > sol.first) {
      sol.first = i - j + 1;
      sol.second = arr[i];
    } else if (i - j + 1 == sol.first and arr[i] < sol.second) {
      sol.second = arr[i];
    }
  }
  cout << sol.first << " " << sol.second;
  return 0;
}
