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.  
  13. int n;
  14. int liczba[] = new int[100];
  15. long pudelko[] = new long[100];
  16. int czas[][] = new int[100][100];
  17. float wynik[] = new float[100];
  18.  
  19. Scanner skan = new Scanner(System.in);
  20. n= skan.nextInt();
  21.  
  22. for(int i=1; i<=n; i++){
  23. liczba[i]= skan.nextInt();
  24. pudelko[i]= skan.nextInt();
  25. for(int j=1; j<=liczba[i]; j++)
  26. czas[i][j]= skan.nextInt();
  27. }
  28.  
  29. for(int i=1; i<=n; i++){
  30. for(int j=1; j<=liczba[i]; j++){
  31. czas[i][j]=86400/czas[i][j];
  32. czas[i][j]=czas[i][j]+czas[i][j-1];
  33. wynik[i]= czas[i][j] ;
  34. }
  35.  
  36. wynik[i]=(float) Math.ceil(wynik[i]/pudelko[i]);
  37. System.out.println((int) wynik[i]);
  38.  
  39. }
  40.  
  41. }
  42. }
Success #stdin #stdout 0.07s 4386816KB
stdin
2
2 10
3600
1800
3 356
123
32999
10101
stdout
8
2