(define w (read)) (define d (read)) (define (answer w d) (if (= 1 d) w (answer (- w (quotient w (* d d)))(- d 1)))) (print(answer w d))