문제링크 : https://www.acmicpc.net/problem/11047
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int N, K;
vector<int> coin;
int main(){
// freopen("../input.txt","rt",stdin);
scanf("%d %d",&N, &K);
int tmp;
for(int i=0; i<N; i++){
scanf("%d",&tmp);
coin.push_back(tmp);
}
int res = 0;
for(int i=N-1; i>=0; i--){
res += K/coin[i];
K = K% coin[i];
if(K == 0) break;
}
printf("%d\n",res);
return 0;
}
K와 /, %를 사용한 아이디어가 좋았다.