fork(8) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a,b,c,d,suma=0;
  7. cin>>a;
  8. for (int i=0;i<a;i++)
  9. {
  10. cin>>b;
  11. for (int i=0;i<b;i++)
  12. {
  13. cin>>c;
  14. suma+=c;
  15. }
  16. d=suma/b;
  17. cout<<d<<endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 2688KB
stdin
3
4 1 2 3 4 
4 4 3 2 1
4 0 3 2 4
stdout
2
5
7