#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  std ::ios_base ::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int mx_ans = *max_element(a.begin(), a.end());
  int mn_ans = mx_ans;
  mx_ans += m;
  while (1) {
    if (m == 0) {
      cout << mn_ans << " " << mx_ans << endl;
      break;
    }
    int mx = max_element(a.begin(), a.end()) - a.begin();
    int mn = min_element(a.begin(), a.end()) - a.begin();
    if (a[mx] == a[mn]) {
      mn_ans = a[mn] + ceil((m * 1.0) / n);
      m = 0;
      continue;
    }
    if (m >= a[mx] - a[mn]) {
      m -= (a[mx] - a[mn]);
      a[mn] = a[mx];
    } else {
      m = 0;
      mn_ans = a[mx];
    }
  }
}
