#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> a;
  for (int i = 0; i < (n); ++i) {
    int x;
    scanf("%d", &x);
    a.push_back(x);
  };
  int MX, mn;
  sort(a.begin(), a.end());
  MX = a[a.size() - 1] + m;
  for (int j = 0; j < (m); ++j) {
    int minin, minv;
    minv = 10000000;
    for (int i = 0; i < (n); ++i) {
      if (a[i] < minv) {
        minin = i;
        minv = a[i];
      }
    }
    a[minin]++;
  }
  int minv;
  minv = 0;
  for (int i = 0; i < (n); ++i) {
    minv = max(minv, a[i]);
  }
  mn = minv;
  printf("%d %d\n", mn, MX);
  return 0;
}
