#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> N >> K; vector a(N+1); a[N]=1e9+7; REP(i,N) cin >> a[i]; sort(a.begin(),a.end()); REP(i,N+1){ if(K-a[i]>=0){ K-=a[i]; }else{ cout << i << ' ' << K << endl; return 0; } } return 0; }