(define (fast-fibo i m) (define (helper n) (if (zero? n) (cons 0 1) (let* ( (result (helper (quotient n 2))) (a (car result)) (b (cdr result)) (md (exact->inexact m)) ) (if (even? n) (cons (modulo (* a (- (* 2 b) a)) md) (modulo (+ (* a a) (* b b)) md)) (cons (modulo (+ (* a a) (* b b)) md) (modulo (* b (+ (* 2 a) b)) md)) ) ) ) ) (inexact->exact (car (helper i))) ) (define yuki526 (display (fast-fibo (- (read) 1) (read))))