(defparameter *N* (read)) (defun formula (a x y) (if (= a (- y x)) (- y x) -1)) (defun solve () (let* ((x_1 (read)) (y_1 (read)) (a (if (> 0 (- y_1 x_1)) -1 (- y_1 x_1)))) (dotimes (i (1- *N*)) (setq a (formula a (read) (read)))) a)) (defun main () (format t "~A~%" (solve))) (main)