#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long mx = m + (*max_element(x.begin(), x.end()));
  long long maxi = *max_element(x.begin(), x.end());
  for (int i = 0; i < n; i++) {
    long long lol = maxi - x[i];
    x[i] += x[i];
    m -= lol;
  }
  if (m <= 0) {
    cout << maxi << " " << mx << endl;
  } else {
    cout << maxi + ((m + n - 1) / n) << " " << mx << endl;
  }
  return 0;
}
