#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
long long int arr[MAX], cum[MAX];
int main() {
  int n;
  long long int k;
  scanf("%d %lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &arr[i]);
  sort(arr + 1, arr + 1 + n);
  cum[0] = 0;
  for (int i = 1; i <= n; i++) cum[i] = cum[i - 1] + arr[i];
  int ans = -10000;
  long long int x = 1000000000000;
  int i = n, j = n;
  while (i > 0 && j > 0) {
    long long int val = arr[j];
    while (i > 0 && arr[i] == val) i--;
    if (i < 1) {
      int f = j - i;
      if (f > ans)
        ans = f, x = val;
      else if (f == ans)
        x = min(x, val);
    } else {
      int f = j - i;
      int hi = i, lo = 1;
      while (hi - lo > 3) {
        int mid = (hi + lo) / 2;
        long long int reqd = (i - mid + 1) * val - (cum[i] - cum[mid - 1]);
        if (reqd <= k)
          hi = mid;
        else
          lo = mid;
      }
      for (int p = lo; p <= hi; p++) {
        long long int reqd = (i - p + 1) * val - (cum[i] - cum[p - 1]);
        if (reqd <= k) {
          f = j - p + 1;
          break;
        }
      }
      if (f > ans)
        ans = f, x = val;
      else if (f == ans)
        x = min(x, val);
    }
    j = i;
  }
  printf("%d %lld\n", ans, x);
  return 0;
}
