(defconstant +mod+ 1000000007) (defun main (&rest argv) (declare (ignorable argv)) (let* ((n (read)) (res 0)) (dotimes (_ n) (let* ((c (read)) (d (read))) (incf res (mod (* (floor (1+ c) 2) d) +mod+)))) (format t "~d~%" (mod res +mod+)))) (main)