(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (res 0)) (when (zerop (mod n 3)) (format t "3~%") (return-from main)) (when (zerop (mod n 4)) (format t "4~%") (return-from main)) (loop for i from 5 to (isqrt n) by 2 when (zerop (mod n i)) do (setq res i) (return)) (cond ((and (evenp n) (zerop res)) (setq res (floor n 2))) ((zerop res) (setq res n)) (t)) (format t "~d~%" res))) (main)