#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int temp, maxN = 0, minN = 0;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    cin >> temp;
    v.push_back(temp);
    if (temp > maxN) maxN = temp;
  }
  sort(v.begin(), v.end());
  int m1 = m;
  for (int i = 0; i < n; ++i) {
    int delta = maxN - v[i];
    if (delta == 0 || m == 0) {
      break;
    }
    if (m >= delta) v[i] += delta <= m ? delta : m;
    m -= delta <= m ? delta : m;
  }
  if (m > 0) {
    minN = v[0] + m / n + (m % n != 0 ? 1 : 0);
  } else {
    minN = maxN;
  }
  cout << minN << " " << maxN + m1 << endl;
  return 0;
}
