(let* ((n (read)) (m (read)) (p (read)) (q (read)) (r (rlet1 v (make-vector 12 1) (let loop ((i p) (j (- (+ p q) 1))) (unless (> i j) (begin (set! (~ v (- i 1)) 2) (loop (+ i 1) j)))))) (result (let loop ((rest n) (a 0) (a1 0)) (let1 rest1 (- rest (* m (~ r a1))) (if (<= rest1 0) (+ a 1) (loop rest1 (+ a 1) (if (= 11 a1) 0 (+ a1 1)))))))) (print result))