#include <bits/stdc++.h>
using namespace std;
int main() {
  int bench, more, temp;
  vector<int> v;
  cin >> bench >> more;
  for (int i = 0; i < bench; i++) {
    cin >> temp;
    v.push_back(temp);
  }
  int min, max = *max_element(v.begin(), v.end());
  ;
  min = *min_element(v.begin(), v.end());
  int max_val = max + more;
  for (int i = 0; i < more; i++) {
    sort(v.begin(), v.end());
    v[0]++;
  }
  std::sort(v.begin(), v.end(), std::greater<int>());
  int min_val = v[0];
  cout << min_val << " " << max_val;
}
