Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int proby;
  10. cin >> proby;
  11.  
  12. int *obzartuchy = new int[proby];
  13. float *w_pudelku = new float[proby];
  14. float *suma = new float[proby];
  15.  
  16. for (int i = 0; i < proby; i++)
  17. {
  18. cin >> obzartuchy[i];
  19. cin >> w_pudelku[i];
  20. float *czasy = new float[obzartuchy[i]];
  21. for (int j = 0; j < obzartuchy[i]; j++)
  22. {
  23. cin >> czasy[j];
  24. suma[i] += floor(86400.0 / czasy[j]);
  25.  
  26. }
  27. }
  28. for (int i = 0; i<proby; i++)
  29. {
  30. int liczba = ceil(suma[i] / w_pudelku[i]);
  31. cout << liczba << endl;
  32. }
  33. system("pause");
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement