fork(3) download
  1. #include<iostream>
  2. #include<math.h>
  3. using namespace std;
  4.  
  5. int testy, czas ,n;
  6. long m;
  7. int ciastka = 0 ,wynik = 0;
  8.  
  9. int main()
  10. {
  11. cin >> testy;
  12. for (int i=1; i<=testy; i++)
  13. {
  14. cin >>n>>m;
  15. for (int j=0; j<=n-1; j++)
  16. {
  17.  
  18. int *czas;
  19. czas = new int [j];
  20. cin >> czas[j];
  21. ciastka += 86400/czas[j] ;
  22. czas ++;
  23. delete [] czas ;
  24.  
  25. }
  26. wynik = ciastka/m;
  27.  
  28. if (ciastka % m != 0)
  29. {
  30. wynik ++ ;
  31.  
  32. }
  33. cout << wynik << endl ;
  34. ciastka = 0 ;
  35. wynik = 0;
  36. m = 0;
  37. n = 0;
  38. }
  39. return 0;
  40.  
  41. }
  42.  
Success #stdin #stdout 0s 2740KB
stdin
Standard input is empty
stdout
Standard output is empty