fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int t;
  6. cin>>t;
  7. while(t--)
  8. {
  9. int persons;
  10. cin>>persons;
  11. int apple,total=0;
  12. for(int i=0;i<persons;i++)
  13. {
  14. cin>>apple;
  15. total+=apple;
  16. }
  17. float day=total/(float)persons;
  18. day=ceil(day);
  19. cout<<day<<endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 15224KB
stdin
1
5
1 2 3 4 5
stdout
3