N,M,K=map(int,input().split()) A=list(map(int,input().split())) S={0} for i in range(K): NS={0} for s in S: for a in A: if s+a<=M: NS.add(s+a) S=NS print(len(S)) print(max(S))