반응형
https://www.acmicpc.net/problem/13458
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
30
31
32
33
34
35
36
37
38
39
40
41
42
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class B13458 {
static int N;
static int[] arr;
static int B,C;
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
N = Integer.parseInt(br.readLine());
arr = new int[N];
st = new StringTokenizer(br.readLine());
for(int i=0;i<N;i++) {
arr[i] = Integer.parseInt(st.nextToken());
}
st = new StringTokenizer(br.readLine());
B = Integer.parseInt(st.nextToken());
C = Integer.parseInt(st.nextToken());
long ans = 0L;
for(int i=0;i<N;i++) {
arr[i] -= B;
ans++;
if(arr[i] <= 0) continue;
ans += arr[i] / C;
if(arr[i] % C != 0) {
ans++;
}
}
System.out.println(ans);
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
반응형
'ProgramSoliving' 카테고리의 다른 글
백준 : 16236 JAVA (0) | 2020.02.02 |
---|---|
백준 : 5373* (0) | 2020.02.01 |
백준 : 15686 (0) | 2020.01.29 |
백준 : 12100 (0) | 2020.01.29 |
백준 : 16235 (0) | 2020.01.28 |