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 if C mod 2 == 0: C = C div 2 else: C = C div 2 + 1 cnt += C.trfm * D.trfm cnt = cnt.trfm echo cnt