```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ``` ```; trabb pardo-knuth algorithm (define (tpk len) (define (f x) (+ (sqrt (abs x)) (* 5 x x x))) (let loop ((len len) (nums '())) (if (positive? len) (loop (- len 1) (cons (read) nums)) (for-each (lambda (x) (let ((result (f x))) (display (if (< 400 result) "TOO LARGE" result)) (newline))) nums)))) (tpk 11) (define (read-number len) (let ((vec (make-vector len 0))) (do ((i 0 (+ i 1)) (num (read) (read))) ((or (= i len)(eof-object? num)) vec) (vector-set! vec i num)))) (define (vector-reverse vec) (do ((lo 0 (+ lo 1)) (hi (- (vector-length vec) 1) (- hi 1))) ((<= hi lo) vec) (let ((t (vector-ref vec lo))) (vector-set! vec lo (vector-ref vec hi)) (vector-set! vec hi t)))) (define (f num) (+ (sqrt (abs num)) (* 5 num num num))) (define (tpk len) (let ((vec (vector-reverse (read-number len)))) (do ((i 0 (+ i 1))) ((= i len)) (let ((result (f (vector-ref vec i)))) (display (if (< 400 result) "TOO LARGE" result)) (newline))))) (tpk 11) ```