#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int a[n], max = INT_MIN;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (max < a[i]) max = a[i];
  }
  long long int maxn = max + m;
  long long int minn, sum = 0;
  for (long long int i = 0; i < n; i++) sum += max - a[i];
  if (sum >= m)
    minn = max;
  else {
    minn = max + ceil((float)(m - sum) / n);
  }
  cout << minn << endl << maxn;
  return 0;
}
