(define (median str) (let* ((sorted (sort str))) (if (= (modulo (length str) 2) 1) (list-ref sorted (quotient (length str) 2)) (/. (+ (list-ref sorted (quotient (length str) 2)) (list-ref sorted (- (quotient (length str) 2) 1))) 2)))) (define (create-list n) (if (= n 0) '() (cons (read) (create-list (- n 1))))) (define (main args) (print (median (create-list (read)))) 0)