n, k = map(int, input().split()) A = list(map(int, input().split())) A.sort() i = 0 while k > A[i]: k -= A[i] i += 1 print(i, k)