import strutils, sequtils, math proc trfm(x: int): int = x mod (10 ^ 9 + 7) let N = stdin.readLine.parseInt var C, D, cnt: int for i in 0 ..< N: (C, D) = stdin.readLine.split.map parseInt C = C div 2 + int(C mod 2 == 1) cnt += C.trfm * D.trfm cnt = cnt.trfm echo cnt