N,K = map(int,input().split()) A = list(map(int,input().split())) A.sort() ans = 0 import sys now = 0 for i in range(N): a = A[i] if now + a > K: print(i,K - now) exit() else: now += a print(N,K - now)