#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  int max1 = m + arr[n - 1];
  for (int i = 0; i < m; i++) {
    sort(arr.begin(), arr.end());
    arr[0] = arr[0] + 1;
  }
  cout << *max_element(arr.begin(), arr.end()) << " " << max1;
}
