- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13458.java
More file actions
Latest commit
29 lines (20 loc) · 645 Bytes
/
Copy path13458.java
File metadata and controls
29 lines (20 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
importjava.util.*;
publicclassMain {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
introomCnt = sc.nextInt();
int[] rooms = newint[roomCnt];
for(inti=0; i<roomCnt; i++) {
rooms[i] = sc.nextInt();
}
intB = sc.nextInt();
intC = sc.nextInt();
longanswer = roomCnt;
for(inti=0; i<roomCnt; i++) {
if(rooms[i]-B <= 0)
continue;
answer += (long)Math.ceil((rooms[i]-B) / (C*1.0));
}
System.out.println(answer);
}
}