Guest User

Untitled

a guest
Mar 17th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. int n = sc.nextInt();
  7. int[] a = new int[n];
  8. for (int z = 0; z < n; z++) {
  9. a[z] = sc.nextInt();
  10. }
  11. int b = sc.nextInt();
  12. int c = sc.nextInt();
  13. for (int z = 0; z < n; z++) {
  14. a[z] -= b;
  15. if (a[z] < 0) {
  16. a[z] = 0;
  17. }
  18. }
  19. long sum = n;
  20. for (int z = 0; z < n; z++) {
  21. sum += a[z] / c;
  22. if (a[z] % c != 0) {
  23. sum++;
  24. }
  25. }
  26. System.out.println(sum);
  27. sc.close();
  28. }
  29. }
Add Comment
Please, Sign In to add comment