#include using namespace std; int main(){ int n,k; cin >> n >> k; vector a(n); for(int i = 0; i < n;i++) cin >> a[i]; sort(a.begin(), a.end()); int num = 0; int rem = k; for(int x: a){ if(rem >= x){ rem -= x; num++; } } cout << num << " " << rem; return 0; }