fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int testy,ile_ciastek,suma,czas,N,M,c,r;
  5. int main()
  6. {
  7. cin>>testy;
  8. for(int i=0; i<testy; i++)
  9. {
  10. suma=0;
  11.  
  12. cin>>N>>M;
  13.  
  14. for(int i=0; i<N; i++)
  15. {
  16.  
  17. cin>>czas;
  18. ile_ciastek=86400/czas;
  19. suma+=ile_ciastek;
  20. }
  21.  
  22. cout<<ceil((double)suma/M)<<endl;
  23. }
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty