링크 : https://www.acmicpc.net/problem/11047
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int N, K;
cin >> N >> K;
vector<int> v;
for(int i = 0; i < N; i++){
int temp;
cin >> temp;
v.push_back(temp);
}
sort(v.begin(), v.end(), greater<int>());
int sum = 0;
for(int i = 0; i < N; i++){
while(K - v[i] >= 0){
sum ++;
K -= v[i];
}
}
cout << sum << '\n';
return 0;
}