fork download
  1.  
  2. (define ncases (read))
  3.  
  4. (define (sum-nums n)
  5. (if (zero? n) 0
  6. (+ (read) (sum-nums (- n 1)))))
  7.  
  8. (define (loop n)
  9. (if (zero? n) '()
  10. (begin (let* ((ssize (read)) (ssum (sum-nums ssize)))
  11. (display (quotient ssum ssize)) (newline))
  12. (loop (- n 1)))))
  13.  
  14. (loop ncases)
  15.  
Success #stdin #stdout 0.01s 7924KB
stdin
2
5
1 2 3 4 5
3
2 1 1
stdout
3
1