#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n);
  long long max = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max) {
      max = a[i];
    }
  }
  max += m;
  if (n == 1) {
    cout << max << " " << max;
    return 0;
  }
  while (m > 0) {
    sort(a.begin(), a.end());
    long long delta = a[1] - a[0] + 1;
    if (delta > m) {
      a[0] += m;
      m = 0;
    } else {
      a[0] += delta;
      m -= delta;
    }
  }
  cout << *max_element(a.begin(), a.end()) << " " << max;
  return 0;
}
