a,b= map(int, input().split()) c = list(map(int, input().split())) c=sorted(c) e=0 if c[0]>b: print(0,b-c[0]) exit() for i in range(len(c)): e+=c[i] if e>b: e-=c[i] break if i==0: print(i+1,b-e) else: print(i,b-e)