#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, z;
priority_queue<int> pq;
int ara[30000];
int main() {
  cin >> n >> m;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    cin >> ara[i];
    mx = max(mx, ara[i]);
    pq.push(-ara[i]);
  }
  mx += m;
  for (int i = 1; i <= m; i++) {
    int xx = -pq.top();
    pq.pop();
    xx++;
    pq.push(-xx);
  }
  while (pq.size() > 1) pq.pop();
  cout << -pq.top() << ' ' << mx << endl;
  return 0;
}
