-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.java
29 lines (21 loc) Β· 873 Bytes
/
Main.java
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
package Math.P13458;
import java.io.*;
import java.util.StringTokenizer;
public class Main {
static int N, B, C;
static int[] A;
public static void main(String[] args) throws Exception {
System.setIn(new FileInputStream("src/Math/P13458/input.txt"));
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
N = Integer.parseInt(br.readLine());
A = new int[N];
StringTokenizer st = new StringTokenizer(br.readLine());
for (int i = 0; i < N; i++) A[i] = Integer.parseInt(st.nextToken());
st = new StringTokenizer(br.readLine());
B = Integer.parseInt(st.nextToken());
C = Integer.parseInt(st.nextToken());
long sum = N;
for (int i = 0; i < N; i++) sum += A[i] - B > 0 ? Math.ceil((double)(A[i] - B) / C) : 0;
System.out.println(sum);
}
}