#include <bits/stdc++.h>
#pragma GCC optimize "Ofast,omit-frame-pointer,inline"
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int mx = -INT_MAX;
  multiset<int> vs;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mx = max(mx, x);
    vs.insert(x);
  }
  mx += m;
  while (m--) {
    int p = *vs.begin();
    vs.insert(p + 1);
    vs.erase(vs.begin());
  }
  cout << (*vs.rbegin()) << " " << mx << endl;
}
