n,k=map(int,input().split()) a,i=sorted(map(int,input().split())),0 while k>a[i]:k-=a[i];i+=1 print(i,k)