#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[105];
  int b[105];
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) b[i] = a[i];
  for (int i = 1; i <= m; i++) b[distance(b, min_element(b + 1, b + n + 1))]++;
  cout << *max_element(b + 1, b + n + 1) << " "
       << *max_element(a + 1, a + n + 1) + m;
  return 0;
}
