-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (34 loc) · 740 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (34 loc) · 740 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
30
31
32
33
34
35
#include <cstdio>
#include <vector>
#define MAX 1000000
using namespace std;
//int result[MAX+1];
int main() {
int n, b, c;
long long sum = 0;
scanf("%d", &n);
vector<int> place(n);
for(int i=0; i<n; i++) {
scanf("%d", &place[i]);
}
scanf("%d %d", &b, &c);
int temp, count;
for(int i=0; i<place.size(); i++) {
/*
if(result[place[i]] != 0) {
sum += result[place[i]];
continue;
}
*/
temp = place[i] - b;
count = 1;
if(temp > 0) {
count += temp / c;
if(temp % c != 0) count++;
}
sum += count;
//result[place[i]] = count;
}
printf("%lld\n", sum);
return 0;
}