fork download
  1. #include <iostream>
  2. using namespace std;
  3. int x,ile_obzartuchow,ile_ciastek,czas,y,testy,pudelko;
  4. int main()
  5. {
  6. cin>>testy;
  7. for (int i=1; i<=testy; i++)
  8. {
  9.  
  10. int suma_ciastek=0;
  11. cin>>ile_obzartuchow>>pudelko;
  12.  
  13.  
  14. for(int i=0; i<ile_obzartuchow; i++)
  15. {
  16. cin>>czas;
  17. ile_ciastek=86400/czas;
  18. suma_ciastek+=ile_ciastek;
  19. }
  20. x=pudelko;
  21. if (suma_ciastek<=pudelko)
  22. {
  23. y=1;
  24. cout<<y<<endl;
  25. }
  26. else{
  27. while(suma_ciastek>x)
  28. {
  29. x+=pudelko;
  30. }
  31.  
  32. cout<<x/pudelko<<endl;
  33. }
  34. }
  35. return 0;
  36. }
  37.  
  38.  
Success #stdin #stdout 0s 15240KB
stdin
2
2 10
3600
1800
3 356
123
32999
10101
stdout
8
2