fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner sc = new Scanner(System.in);
  13. int liczba1 = sc.nextInt();
  14. int a = 0;
  15. int b = 0;
  16. for (int i = 0; i < liczba1; i++) {
  17. a = sc.nextInt();
  18. b = sc.nextInt();
  19. if (a >= 1 && a <= 10000 && b >= 1 && b <= 1000000000) ;
  20. int iloscCiastek = 0;
  21. int iloscPudelek;
  22. for (int j = 0; j < a; j++) {
  23. double sekundy = sc.nextDouble();
  24. if (sekundy <= 100000) {
  25. double suma = 86400 / sekundy;
  26. iloscCiastek += suma;
  27. }
  28. }
  29.  
  30. if (iloscCiastek % b == 0) {
  31. iloscPudelek = iloscCiastek / b;
  32. } else {
  33. iloscPudelek = (iloscCiastek / b) + 1;
  34. }
  35.  
  36. System.out.println(iloscPudelek);
  37.  
  38. }
  39. }
  40. }
Success #stdin #stdout 0.15s 31492KB
stdin
2
2 10
3600
1800
3 356
123
32999
10101
stdout
8
2