Advertisement
Glenpl

glotton spoj

Jul 25th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int day = 24 * 60 * 60, t, N, M, cookies, time;
  7.  
  8.     std::cin >> t;
  9.  
  10.     while(t-- != 0)
  11.     {
  12.        cookies = 0;
  13.        std::cin >> N >> M;
  14.  
  15.        while(N-- != 0)
  16.        {
  17.         std::cin >> time;
  18.             cookies += day / time;
  19.        }
  20.  
  21.        std::cout << ceil(static_cast<double>(cookies) / M) << "\n";
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement