Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt();
- int[] a = new int[n];
- for (int z = 0; z < n; z++) {
- a[z] = sc.nextInt();
- }
- int b = sc.nextInt();
- int c = sc.nextInt();
- for (int z = 0; z < n; z++) {
- a[z] -= b;
- if (a[z] < 0) {
- a[z] = 0;
- }
- }
- long sum = n;
- for (int z = 0; z < n; z++) {
- sum += a[z] / c;
- if (a[z] % c != 0) {
- sum++;
- }
- }
- System.out.println(sum);
- sc.close();
- }
- }
Add Comment
Please, Sign In to add comment