fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int ile,ile_u,ile_wp;
  7. int *czas;
  8.  
  9. int ciastka()
  10. {
  11. double x=0;
  12.  
  13. for (int i = 0; i < ile_u; i++)
  14. {
  15. x+=86400/czas[i];
  16. }
  17.  
  18. x/=ile_wp;
  19.  
  20. return ceil(x);
  21. }
  22.  
  23. int main()
  24. {
  25. cin>>ile;
  26.  
  27. for(int i=0; i<ile; i++)
  28. {
  29. cin>>ile_u>>ile_wp;
  30.  
  31. czas = new int [ile];
  32.  
  33. for (int i=0; i<ile_u; i++)
  34. {
  35. cin>>czas[i];
  36. }
  37. cout<<ciastka()<<endl;
  38. }
  39.  
  40. return 0;
  41. }
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
Standard output is empty