🙆♀️ 정답 코드
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int K = Integer.parseInt(st.nextToken());
int[] arr = new int[N + 1];
for (int i = 1; i <= N; i++) {
arr[i] = Integer.parseInt(br.readLine());
}
int cnt = 0;
for(int j=arr.length-1;j>0; j--){
if(arr[j]<=K){
int div = K/arr[j];
cnt+=div;
K=K%arr[j];
}
}
System.out.println(cnt);
}
}