https://www.acmicpc.net/problem/11047
int solution(int k, vector<int> a){
int answer =0;
int i = 0;
while(k != 0){
int value = a[a.size()-1-i];
if(k / value != 0){
answer += k / value;
k = k%value;
}
i++;
}
return answer;
}
#include <stdio.h>
int n, m, a[12], i, cnt;
main()
{
scanf("%d %d", &n, &m);
for(i=0; i<n; i++)
scanf("%d", a+i);
for(i=n-1; i>=0; i--)
{
cnt+=m/a[i];
m%=a[i];
}
printf("%d", cnt);
}