#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, min, mini, max = -1, max1 = -1, t;
  int a[100];
  cin >> n >> m;
  t = m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max) {
      max = a[i];
    }
  }
  while (t > 0) {
    min = 10001;
    for (int i = 0; i < n; i++) {
      if (a[i] < min) {
        min = a[i];
        mini = i;
      }
    }
    a[mini]++;
    t--;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] > max1) {
      max1 = a[i];
    }
  }
  cout << max1 << " " << max + m;
  return 0;
}
