(defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (a '())) (dotimes (i n) (let ((p (read)) (q (read))) (push (cons p q) a))) (setf a (sort a #'> :key (lambda (frac) (/ (car frac) (cdr frac))))) (dolist (x a) (format t "~d ~d~%" (car x) (cdr x))))) (main)