#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, i, j, l, r, mid, a[100005], temp, count, b[100005],
      s[100005];
  scanf("%lld", &n), scanf("%lld", &k);
  s[0] = 0;
  for (i = 1; i < n + 1; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i < n + 1; i++) s[i] = s[i - 1] + a[i];
  for (i = 1; i <= n; i++) {
    l = 1;
    r = i;
    while (l <= r) {
      mid = l + ((r - l) / 2);
      temp = a[i] * mid - (s[i] - s[i - mid]);
      if (temp <= k) {
        if (l != mid)
          l = mid;
        else
          l = mid + 1;
      } else
        r = mid - 1;
    }
    if (a[i] * mid - (s[i] - s[i - mid]) <= k) {
      b[i] = mid;
    } else {
      b[i] = mid - 1;
    }
  }
  long long int ans = -1;
  long long int ans1;
  for (i = 1; i < n + 1; i++) {
    if (b[i] > ans) {
      ans = b[i];
      ans1 = a[i];
    }
  }
  printf("%lld %lld\n", ans, ans1);
  return 0;
}
