fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int zestawy, n, m;
  5. int x=1;
  6. int main()
  7. {
  8. cin>>zestawy;
  9. int liczba_pudelek[zestawy];
  10. int ciastka[zestawy];
  11. int sekundy[n];
  12. while(zestawy>=x)
  13. {
  14. cin>>n>>m;
  15. for(int i=1; i<=n; i++)
  16. {
  17. cin>>sekundy[i-1];
  18. ciastka[x-1]=86400/sekundy[i-1]+ciastka[x-1];
  19. }
  20. liczba_pudelek[x-1]=0;
  21. while(m*liczba_pudelek[x-1]<ciastka[x-1])
  22. {liczba_pudelek[x-1]++;}
  23. x++;
  24. }
  25.  
  26. x=0;
  27. while(zestawy>x)
  28. {
  29. cout<<liczba_pudelek[x]<<endl;
  30. x++;
  31. }
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty