n,m=map(int,input().split())
li={int(x) for x in input().split()}
def ch(g):
tot=0
for gx in li:
tot+=max(gx-g,0)
return tot>=m
l,r=0,1e6
while l<=r:
m=int((l+r+1)/2)
if ch(m):
l=m+1
else:
r=m-1
print(int(l),r)
'''4 7
20 15 10 17'''
'''5 20
4 42 40 26 46'''