문제출처 : https://www.acmicpc.net/problem/11047
code
#include <stdio.h>
int main()
{
int N, K, i, coin[10] = { 0 }, cnt = 0;
scanf("%d %d", &N, &K);
for (i = 0; i < N; i++)
scanf("%d", &coin[i]);
for (i = N - 1; i >= 0; i--)
{
if (coin[i] <= K)
{
cnt += K / coin[i];
K = K % coin[i];
}
}
printf("%d", cnt);
return 0;
}