n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() s=0 for i in range(n): s+=a[i] if s>k: break print(i,k-s+a[i])