import std; void main () { int N, K; readln.read(N, K); int[] A = readln.split.to!(int[]); A.sort; int ans = 0; long sum = 0; while (true) { if (ans == A.length || K < sum + A[ans]) { break; } sum += A[ans]; ans++; } writeln(ans, " ", K-sum); } void read(T...)(string S, ref T args) { auto buf = S.split; foreach (i, ref arg; args) { arg = buf[i].to!(typeof(arg)); } }