(defun sum-square (x y z) (cond ((and (> x y) (> z y)) (+ (* x x) (* 2 x z) (* z z))) ((and (> y x) (> z x)) (+ (* y y) (* 2 z y) (* z z))) ((and (> x z) (> y z)) (+ (* x x) (* 2 x y) (* y y))))) CL-USER> (sum-square 1 2 3) 25 CL-USER> (sum-square 4 5 6) 121 CL-USER> (sum-square 6 5 4) 121 CL-USER> (sum-square 4 6 5) 121