#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int mn = 0, arr[n], mx = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    mx = max(mx, arr[i]);
  }
  for (int i = 0; i < n; i++) {
    sum += (mx - arr[i]);
  }
  mn = max(mx, mx + (m - sum + n - 1) / n);
  cout << mn << ' ' << mx + m;
}
