#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  float m, tot = 0;
  cin >> n >> m;
  float ar[n];
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    tot += ar[i];
  }
  sort(ar, ar + n);
  if (n * ar[n - 1] - tot >= m)
    cout << ar[n - 1] << " ";
  else
    cout << ceil((m - n * ar[n - 1] + tot) / n) + ar[n - 1] << " ";
  cout << m + ar[n - 1];
}
