#include using namespace std; int main() { long long N,K; cin >> N >> K; vector A(N); for(int i = 0; i < N; i++) cin >> A[i]; sort(A.begin(),A.end()); for(int i = 0; i < N; i++) { if(K > A[i]) K -= A[i]; else { cout << i << " " << K << endl; return 0; } } cout << N << " " << K << endl; }