n, k = map(int, input().split()) s = 0 for i, j in enumerate(sorted(map(int, input().split()))): s += j if s > k: exit(print(i, k - s + j))