fork download
  1. import math
  2.  
  3. liczba_testow = int(input())
  4. liczby = []
  5. suma = 0
  6.  
  7. for i in range(liczba_testow):
  8. wpis = [int(x) for x in input().split()]
  9. liczby.append(wpis)
  10.  
  11.  
  12. for j in range(liczba_testow):
  13. for k in range(1, (liczby[j][0]+1)):
  14. suma = suma + liczby[j][k]
  15. srednia = suma / liczby[j][0]
  16. suma = 0
  17. a = liczby[j][1]
  18. for l in range (1, (liczby[j][0]+1)):
  19. if math.fabs(srednia-a) > math.fabs(srednia-liczby[j][l]):
  20. a = liczby[j][l]
  21. print(a)
Runtime error #stdin #stdout #stderr 0.02s 27616KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 3, in <module>
EOFError: EOF when reading a line