(define (System.out.println x) (begin (display x) (newline) ) ) (let ( (N (read)) ) (let loop( (i 0) (Sum 0) ) (if (= i N) (System.out.println (modulo Sum 1000000007)) (loop (+ i 1) (+ Sum (* (ceiling (/ (read) 2)) (read)))) ) ) )