#include <bits/stdc++.h>
using namespace std;
int m, n, A[202020];
int main() {
  scanf("%d %d", &n, &m);
  int ans2 = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]), ans2 = max(ans2, A[i]);
  ans2 += m;
  for (int i = 1; i <= m; i++) {
    int pos = 1;
    for (int j = 2; j <= n; j++)
      if (A[j] < A[pos]) pos = j;
    A[pos]++;
  }
  int ans1 = A[1];
  for (int i = 2; i <= n; i++) ans1 = max(ans1, A[i]);
  printf("%d %d\n", ans1, ans2);
}
