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