public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] students = new int[n];
StringTokenizer st = new StringTokenizer(br.readLine());
for (int i = 0; i < n; i++) {
students[i] = Integer.parseInt(st.nextToken());
}
st = new StringTokenizer(br.readLine());
int mainSupervisor = Integer.parseInt(st.nextToken());
int subSupervisor = Integer.parseInt(st.nextToken());
System.out.println(calculateSupervisors(students, mainSupervisor, subSupervisor));
}
private static long calculateSupervisors(int[] students, int mainSupervisor, int subSupervisor) {
long totalSupervisors = 0;
for (int studentsInRoom : students) {
totalSupervisors += 1;
int remaining = studentsInRoom - mainSupervisor;
if (remaining > 0) {
totalSupervisors += remaining / subSupervisor;
if (remaining % subSupervisor != 0) {
totalSupervisors++;
}
}
}
return totalSupervisors;
}
출처:https://www.acmicpc.net/problem/13458
