; 全ての yi - xi を求める ; その値が正の整数かつ全て同じ値ならばそれを出力 ; そうでなければ -1 を出力する (defun main () (let* ((n (read)) ; remove-duplicates sequence &key from-end test test-not start end key => result-sequence ; sequence の中の重複する要素を除いたシーケンスをコピーして返す (xs (remove-duplicates (loop repeat n for x = (read) for y = (read) collect (- y x)))) (xslen (length xs)) (ans (car xs))) (princ (if (and (= xslen 1) (plusp ans)) ans -1)) (terpri))) (main)