fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int ile,ip2,n;
  5. float ip,m,ip3;
  6.  
  7. int main() {
  8. // your code goes here
  9. cin>>ile;
  10. for(int i=1; i<=ile; i++)
  11. {
  12. cin>>n>>m;
  13. int suma=0;
  14.  
  15. float *czas;
  16. czas = new float [n];
  17.  
  18. for (int i=0; i<n; i++)
  19. {
  20. cin>>czas[i];
  21. }
  22.  
  23. for (int i=0; i<n; i++)
  24. {
  25. suma+=(86400/czas[i]);
  26. }
  27.  
  28. ip=suma/m;
  29. ip2=ip;
  30. ip3=ip-ip2;
  31.  
  32.  
  33. if (ip3!=0)
  34. {
  35. ip2+=1;
  36. }
  37. cout<<ip2<<endl;
  38. delete []czas;
  39. }
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0s 5496KB
stdin
4
2 10
3600
1800
3 356
123
32999
10101
2 10
3600
1800
3 356
123
32999
10101
stdout
8
2
8
2