fork download
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int N, M, n;
  6. int ile;
  7. float x = 0;
  8. int y = 0;
  9. int main()
  10. {
  11. cin >> ile;
  12. for (int i = 1; i <= ile; i++)
  13. {
  14. x = 0;
  15. y = 0;
  16. int *tab1;
  17. float *tab2;
  18. cin >> N >> M;
  19. tab1 = new int[N];
  20. tab2 = new float[N];
  21. for (int j = 1; j <= N; j++)
  22. {
  23. cin >> tab1[j];
  24. tab2[j] = floor((1 / ((float)tab1[j])) * 86400);
  25. y += tab1[j];
  26. x += floor((tab2[j]));
  27. }
  28. n = ceil(x / M);
  29. cout << n << endl;
  30. delete[] tab1;
  31. delete[] tab2;
  32. }
  33.  
  34. return 0;
  35. }
Success #stdin #stdout 0s 15240KB
stdin
2
2 10
3600
1800
3 356
123
32999
10101
stdout
8
2