#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INF64 = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-8;
const double PI = acos(-1.0);
const int MOD = 1000000007;
const int N = 2e3 + 10;
const int M = 1e5 + 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  int m;
  cin >> m;
  int maxans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    maxans = max(a[i], maxans);
  }
  sort(a.begin(), a.end());
  int t = m;
  for (int i = 0; i < n - 1; ++i) {
    if (t > (i + 1) * (a[i + 1] - a[i]))
      t -= (i + 1) * (a[i + 1] - a[i]);
    else {
      t = 0;
      break;
    }
  }
  cout << a.back() + (t / n + (t % n != 0)) << ' ' << maxans + m << '\n';
  return 0;
}
