SICP Practice

Practice 4.40

(define (multiple-dwelling)
  (let ((cooper (amb 2 3 4))
        (miller (amb 2 3 4 5)))
    (require (> miller cooper))
    (let ((fletcher (amb 2 3 4)))
      (require (not (= (abs (- fletcher cooper)) 1)))
      (let (smith (amb 1 2 3 4 5))
        (require (not (= (abs (- smith fletcher)) 1)))
        (let ((baker (amb 1 2 3 4 5)))
          (require (distinct? (list backer cooper fletcher miller smith)))
          (list (list 'backer backer)
                (list 'cooper cooper)
                (list 'fletcher fletcher)
                (list 'miller miller)
                (list 'smith smith))))))